1
0
Fork 0
mirror of https://github.com/betagouv/mon-entreprise synced 2025-02-08 23:25:02 +00:00
mon-entreprise/site/scripts/build-sitemap.ts
Jérémy Rialland 7d4aabe35e Format prettier
2022-11-15 12:47:44 +01:00

22 lines
678 B
TypeScript

import { writeFileSync } from 'node:fs'
import { absoluteSitePaths, generateSiteMap } from '../source/sitePaths.js'
const basePathEn =
process.env.VITE_EN_BASE_URL ?? 'http://localhost:3000/infrance'
const basePathFr =
process.env.VITE_FR_BASE_URL ?? 'http://localhost:3000/mon-entreprise'
const enSiteMap = generateSiteMap(absoluteSitePaths.en).map(
(path) => basePathEn + path
)
const frSiteMap = generateSiteMap(absoluteSitePaths.fr).map(
(path) => basePathFr + path
)
writeFileSync('source/public/sitemap.en.txt', enSiteMap.join('\n') + '\n', {
encoding: 'utf8',
})
writeFileSync('source/public/sitemap.fr.txt', frSiteMap.join('\n') + '\n', {
encoding: 'utf8',
})