Add SEO data generation and testing for bilingual pages

- Implemented SEO data structures for programmatic tool and collection pages.
- Created functions to build FAQs and content sections for SEO pages.
- Added tests to ensure at least 50 bilingual SEO pages are generated, no duplicate English slugs, and matching Arabic localized paths.
- Verified that both tool and collection SEO inventories are populated adequately.
This commit is contained in:
Your Name
2026-03-21 10:55:43 +02:00
parent a8a7ec55a2
commit c800f707e3
12 changed files with 1920 additions and 22 deletions

View File

@@ -10,7 +10,7 @@ const siteOrigin = String(process.env.VITE_SITE_DOMAIN || 'https://dociva.io').t
const today = new Date().toISOString().slice(0, 10);
const seoConfig = JSON.parse(
await readFile(path.join(frontendRoot, 'src', 'config', 'seo-tools.json'), 'utf8')
await readFile(path.join(frontendRoot, 'src', 'seo', 'seoData.json'), 'utf8')
);
const staticPages = [
@@ -91,12 +91,18 @@ const sitemapEntries = [
...[...toolRoutePriorities.entries()].map(([slug, priority]) =>
makeUrlTag({ loc: `${siteOrigin}/tools/${slug}`, changefreq: 'weekly', priority })
),
...seoConfig.toolPages.map((page) =>
...seoConfig.toolPageSeeds.map((page) =>
makeUrlTag({ loc: `${siteOrigin}/${page.slug}`, changefreq: 'weekly', priority: '0.88' })
),
...seoConfig.collectionPages.map((page) =>
...seoConfig.toolPageSeeds.map((page) =>
makeUrlTag({ loc: `${siteOrigin}/ar/${page.slug}`, changefreq: 'weekly', priority: '0.8' })
),
...seoConfig.collectionPageSeeds.map((page) =>
makeUrlTag({ loc: `${siteOrigin}/${page.slug}`, changefreq: 'weekly', priority: '0.82' })
),
...seoConfig.collectionPageSeeds.map((page) =>
makeUrlTag({ loc: `${siteOrigin}/ar/${page.slug}`, changefreq: 'weekly', priority: '0.74' })
),
];
const sitemap = `<?xml version="1.0" encoding="UTF-8"?>\n<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n${sitemapEntries.join('\n')}\n</urlset>\n`;