feat: translate all pages, UI messages and docs and fix SEO redirects and indexing

This commit is contained in:
alam00000
2026-10-25 12:55:21 +05:30
parent 5e019de5ae
commit 4edb1718cc
3344 changed files with 415643 additions and 4759 deletions
+11 -2
View File
@@ -111,7 +111,14 @@ 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}`);
const html = fs.readFileSync(path.join(dir, entry.name), 'utf-8');
const canonical = html.match(
/<link[^>]+rel="canonical"[^>]+href="([^"]+)"/
);
urls.push({
url: slug === 'index' ? prefix : `${prefix}/${slug}`,
canonical: canonical ? canonical[1] : null,
});
}
}
return urls;
@@ -132,7 +139,9 @@ function addDocsToSitemap() {
let xml = fs.readFileSync(sitemapPath, 'utf-8');
if (xml.includes(`<loc>${siteUrl}/docs</loc>`)) return;
const urls = listDocsHtml(targetDocsPath, '/docs');
const urls = listDocsHtml(targetDocsPath, '/docs')
.filter(({ url, canonical }) => canonical === `${siteUrl}${url}`)
.map(({ url }) => url);
const entries = urls
.map(
(url) =>