mirror of
https://github.com/alam00000/bentopdf.git
synced 2026-11-08 16:57:14 +01:00
fix: serve canonical, hreflang and sitemap URLs and restore Export in the PDF editor
This commit is contained in:
1 parent
7eec9a0d64
commit
6e8e012d3d
20 files changed
+209
-53
No files matched your search
@@ -111,7 +111,7 @@ function listDocsHtml(dir, prefix) {
|
||||
);
|
||||
} else if (entry.name.endsWith('.html') && entry.name !== '404.html') {
|
||||
const slug = entry.name.replace(/\.html$/, '');
|
||||
urls.push(slug === 'index' ? `${prefix}/` : `${prefix}/${slug}`);
|
||||
urls.push(slug === 'index' ? prefix : `${prefix}/${slug}`);
|
||||
}
|
||||
}
|
||||
return urls;
|
||||
@@ -130,7 +130,7 @@ function addDocsToSitemap() {
|
||||
return;
|
||||
}
|
||||
let xml = fs.readFileSync(sitemapPath, 'utf-8');
|
||||
if (xml.includes(`<loc>${siteUrl}/docs/</loc>`)) return;
|
||||
if (xml.includes(`<loc>${siteUrl}/docs</loc>`)) return;
|
||||
|
||||
const urls = listDocsHtml(targetDocsPath, '/docs');
|
||||
const entries = urls
|
||||
|
||||
Reference in new issue
Block a user