microsite: flatten release section

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-03-14 15:54:02 +01:00
parent 2a80a3e88b
commit 6582844118
3 changed files with 16 additions and 17 deletions
-7
View File
@@ -1,7 +0,0 @@
---
id: overview
title: Overview
description: Overview of the Backstage Releases
---
Things have been released!
+2 -9
View File
@@ -1,14 +1,7 @@
{
"releases": {
"Releases": [
"releases/overview",
{
"type": "subcategory",
"label": "Release Notes",
"ids": [
"releases/v1.0.0"
]
}
"Release Notes": [
"releases/v1.0.0"
]
},
"docs": {
+14 -1
View File
@@ -8,6 +8,19 @@
// See https://docusaurus.io/docs/site-config for all the possible
// site configuration options.
// This figures out what the most recent release version is, so that we can link to it in the header
const [{name: latestRelease}] = require('fs').readdirSync(require('path').resolve(__dirname, '../docs/releases')).map(file => {
const match = file.match(/^v(\d+)\.(\d+)\.(\d+)\.md$/)
if (!match) {
return undefined
}
const parts = match.slice(1).map(v => parseInt(v, 10))
return {
name: file.slice(0, file.length - '.md'.length),
weight: parts[0]*1000000 + parts[1]*1000 + parts[2],
}
}).filter(Boolean).sort((a, b) => b.weight - a.weight);
const siteConfig = {
title: 'Backstage Software Catalog and Developer Platform', // Title for your website.
tagline: 'An open platform for building developer portals',
@@ -45,7 +58,7 @@ const siteConfig = {
label: 'Blog',
},
{
doc: 'releases/overview',
doc: `releases/${latestRelease}`,
href: '/releases',
label: 'Releases',
},