Skip to content

Commit

Permalink
fix about/about link in sitemap
Browse files Browse the repository at this point in the history
  • Loading branch information
mistermicheels committed Aug 14, 2022
1 parent c24c28a commit c7f44b9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion _scripts/generate-sitemap.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ function getDocIds(sidebarItems) {

for (const item of sidebarItems) {
if (typeof item === "string") {
docIds.push(item);
// we renamed about.md -> about-note.md so Docusaurus doesn't think it's a category description
// however, the final URL is still about/about
docIds.push(item === "about/about-note" ? "about/about" : item);
} else {
docIds.push(...getDocIds(item.items));
}
Expand All @@ -70,6 +72,10 @@ async function getSitemap(allPageSuffixes) {
}

function getLastModifiedString(pageSuffix) {
if (pageSuffix.startsWith("about")) {
return undefined;
}

const filePath = path.join(process.cwd(), "_website", "docs", pageSuffix + ".md")
const contents = fsExtra.readFileSync(filePath, { encoding: "utf-8" });
const parsedFrontMatter = frontMatter(contents);
Expand Down

0 comments on commit c7f44b9

Please sign in to comment.