|
| 1 | +import { getCollection } from "@dzcode.io/data/dist/get/collection"; |
| 2 | +import { allLanguages } from "@dzcode.io/models/dist/language"; |
1 | 3 | import { createWriteStream } from "fs"; |
| 4 | +import { join } from "path"; |
2 | 5 | import { SitemapStream } from "sitemap"; |
| 6 | + |
3 | 7 | const distFolder = "./bundle"; |
4 | | -import { getCollection } from "@dzcode.io/data/dist/get/collection"; |
5 | | -import { join } from "path"; |
6 | 8 |
|
7 | 9 | // Static URLs |
8 | 10 | console.log("Getting Static URLs ..."); |
9 | | -const urls = ["/", "/Contribute", "/Learn", "/Projects", "/Articles", "/FAQ"]; |
| 11 | +const urls = ["/", "/Contribute", "/Learn", "/Projects", "/Articles", "/FAQ", "/Team"].reduce( |
| 12 | + (pV, uri) => [...pV, ...allLanguages.map(({ code }) => (code === "en" ? uri : `/${code}${uri}`))], |
| 13 | + [] as string[], |
| 14 | +); |
10 | 15 | console.log("✅", urls.length, "URLs Found"); |
11 | 16 |
|
12 | 17 | // Dynamic URLs |
| 18 | +// @TODO-ZM: to localize this |
13 | 19 | console.log("Getting Dynamic URLs ..."); |
14 | 20 | [ |
15 | 21 | { file: "articles", slug: "Articles" }, |
16 | 22 | { file: "documentation", slug: "Learn" }, |
17 | | - { file: "projects", slug: "Projects" }, |
| 23 | + // { file: "projects", slug: "Projects" }, // @TODO-ZM: to put back when we have proper project details page |
18 | 24 | ].forEach((collectionInfo) => { |
19 | 25 | const collection = getCollection<Record<string, string>>( |
20 | 26 | join(__dirname, "../../../data"), |
|
0 commit comments