|
1 | | -import { processDirectoryRecursiveSync } from "@compas/stdlib"; |
2 | | -import { resolve } from "node:path"; |
3 | | -import { readdirSync, writeFileSync } from "node:fs"; |
| 1 | +import { readdirSync } from "node:fs"; |
4 | 2 | import { defineConfig } from "vitepress"; |
5 | 3 |
|
6 | 4 | export default defineConfig({ |
@@ -38,7 +36,7 @@ export default defineConfig({ |
38 | 36 | ["link", { rel: "shortcut icon", href: "/favicon/favicon.ico" }], |
39 | 37 | ["meta", { name: "theme-color", content: "#3EAF7C" }], |
40 | 38 | ], |
41 | | - lastUpdated: true, |
| 39 | + lastUpdated: false, |
42 | 40 |
|
43 | 41 | themeConfig: { |
44 | 42 | logo: "/compas-icon.svg", |
@@ -109,31 +107,8 @@ export default defineConfig({ |
109 | 107 | envDir: process.cwd() + "/docs", |
110 | 108 | }, |
111 | 109 |
|
112 | | - buildEnd: (config) => { |
113 | | - const outFile = resolve(config.outDir, "sitemap.xml"); |
114 | | - const baseUrl = "https://compasjs.com/"; |
115 | | - |
116 | | - let sitemap = `<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">`; |
117 | | - |
118 | | - processDirectoryRecursiveSync(config.outDir, (f) => { |
119 | | - if (!f.endsWith(".html")) { |
120 | | - return; |
121 | | - } |
122 | | - |
123 | | - if (f.includes("404.html")) { |
124 | | - return; |
125 | | - } |
126 | | - |
127 | | - const path = f.split("/dist/").pop(); |
128 | | - sitemap += `<url> |
129 | | - <loc>${baseUrl}${path}</loc> |
130 | | - <lastmod>${new Date().toISOString()}</lastmod> |
131 | | - <changefreq>daily</changefreq> |
132 | | - <priority>0.7</priority> |
133 | | -</url>`; |
134 | | - }); |
135 | | - sitemap += `</urlset>`; |
136 | | - writeFileSync(outFile, sitemap); |
| 110 | + sitemap: { |
| 111 | + hostname: "https://compasjs.com", |
137 | 112 | }, |
138 | 113 | }); |
139 | 114 |
|
|
0 commit comments