fix sitemap route

This commit is contained in:
Raven Scott 2024-09-16 14:25:49 -04:00
parent 2b696a93de
commit 8f5ce78b73

2
app.js
View File

@ -240,7 +240,7 @@ app.get('/sitemap.xml', (req, res) => {
let sitemap = `<?xml version="1.0" encoding="UTF-8"?>\n<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n`; let sitemap = `<?xml version="1.0" encoding="UTF-8"?>\n<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n`;
urls.forEach(({ url, lastmod, changefreq, priority }) => { urls.forEach(({ url, lastmod, changefreq, priority }) => {
sitemap += ` <url>\n`; sitemap += ` <url>\n`;
sitemap += ` <loc>${hostname}${url}</loc>\n`; sitemap += ` <loc>https://${hostname}${url}</loc>\n`;
if (lastmod) { if (lastmod) {
sitemap += ` <lastmod>${lastmod}</lastmod>\n`; sitemap += ` <lastmod>${lastmod}</lastmod>\n`;
} }