Fix sitemap explore URL not being URI encoded

This commit is contained in:
Peaceultime 2024-12-11 13:43:26 +01:00
parent a3d9e466a5
commit 36909c5d66
1 changed files with 1 additions and 1 deletions

View File

@ -7,7 +7,7 @@ export default defineSitemapEventHandler(() => {
const pages = db.select({ path: explorerContentTable.path, lastMod: explorerContentTable.timestamp, navigable: explorerContentTable.navigable, private: explorerContentTable.private }).from(explorerContentTable).all();
return pages.filter(e => e.navigable && !e.private && e.path.split('/').map((_, i, a) => a.slice(0, i).join('/')).every(p => !pages.find(_p => _p.path === p)?.private)).map(e => ({
loc: `/explore/${e.path}`,
loc: `/explore/${encodeURIComponent(e.path)}`,
lastmod: e.lastMod,
})) satisfies SitemapUrlInput[];
})