Merge pull request #4421 from joaomilho/master

docs: Fix broken links in microsite
This commit is contained in:
Patrik Oldsberg
2021-02-26 17:35:43 +01:00
committed by GitHub
6 changed files with 60 additions and 9 deletions
+2 -1
View File
@@ -11,7 +11,8 @@
"publish-gh-pages": "docusaurus-publish",
"write-translations": "docusaurus-write-translations",
"version": "docusaurus-version",
"rename-version": "docusaurus-rename-version"
"rename-version": "docusaurus-rename-version",
"verify:sidebars": "node ./scripts/verify-sidebars"
},
"devDependencies": {
"@spotify/prettier-config": "^9.0.0",
+51
View File
@@ -0,0 +1,51 @@
/*
* Copyright 2020 Spotify AB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* This script relies on docusaurus internals. It can be replaced in case
* docusaurus adds proper validation of the sidebar items.
*/
let metadata;
try {
metadata = require('docusaurus/lib/core/metadata.js');
} catch (error) {
console.log('❌ Run `yarn build` before running `yarn verify:sidebars`');
process.exit(1);
}
const errors = [];
const ids = Object.keys(metadata);
for (let id of ids) {
const { next, previous } = metadata[id];
if (next && !ids.includes(next)) {
errors.push(`Next ${next} does not exist in ${id}.`);
}
if (previous && !ids.includes(previous)) {
errors.push(`Previous ${previous} does not exist in ${id}.`);
}
}
if (errors.length) {
for (const error of errors) {
console.log(`${error}`);
}
process.exit(1);
}
console.log('✅ All sidebar links are correct.');
+2 -5
View File
@@ -13,7 +13,7 @@
"Getting Started": [
"getting-started/index",
"getting-started/running-backstage-locally",
"getting-started/contributing",
"getting-started/contributors",
"getting-started/create-an-app",
{
"type": "subcategory",
@@ -59,7 +59,6 @@
"features/software-catalog/well-known-relations",
"features/software-catalog/extending-the-model",
"features/software-catalog/external-integrations",
"features/software-catalog/kubernetes-in-backstage",
"features/software-catalog/software-catalog-api"
]
},
@@ -180,8 +179,7 @@
"api/utility-apis",
"reference/utility-apis/README",
"reference/createPlugin",
"reference/createPlugin-feature-flags",
"reference/createPlugin-router"
"reference/createPlugin-feature-flags"
]
},
{
@@ -209,7 +207,6 @@
"architecture-decisions/adrs-adr010",
"architecture-decisions/adrs-adr011"
],
"Contribute": ["../CONTRIBUTING"],
"Support": ["support/support", "support/project-structure"],
"Glossary": ["glossary"],
"FAQ": ["FAQ"]