Skip to content

Commit

Permalink
chore: amend sitemap.xml output
Browse files Browse the repository at this point in the history
  • Loading branch information
SethFalco committed May 21, 2024
1 parent 2b0793d commit 955f9ae
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,27 @@ const config = {
filename: "sitemap.xml",
ignorePatterns: [
"/.well-known/**"
]
],
createSitemapItems: async (params) => {
const { defaultCreateSitemapItems, ...rest } = params;

/** @type {object[]} */
let items = await defaultCreateSitemapItems(rest);
items = items.map((item) => {
const pathname = new URL(item.url).pathname;

if (pathname === "/") {
item.priority = 1;
} else if (pathname === "/search/") {
item.priority = 0.1;
item.changefreq = "monthly";
}

return item;
});

return items;
},
}
],
"./src/plugins/prefers-color-scheme.js",
Expand Down

0 comments on commit 955f9ae

Please sign in to comment.