-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathreact-router.config.ts
More file actions
41 lines (33 loc) · 914 Bytes
/
react-router.config.ts
File metadata and controls
41 lines (33 loc) · 914 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import type { Config } from "@react-router/dev/config";
import { FLAGS } from "./app/flags.ts";
import fm from "front-matter";
import * as glob from "glob";
import fs from "node:fs";
export const POSTS = glob
.sync("./app/data/articles/*/article.mdx")
.map((file) => {
const post = fs.readFileSync(file, "utf-8");
return fm(post).attributes as { slug: string; published?: boolean };
});
export default {
ssr: false,
async prerender() {
return [
"/",
"/cv",
"/cv.pdf",
"/blog",
...POSTS.filter((_) => _.published !== false).map(
(post) => `/blog/${post.slug}`
),
...POSTS.filter((_) => _.published !== false).map(
(post) => `/blog/${post.slug}/og-image.png`
),
"/rss.xml",
"/atom.xml",
"/feed.json",
"/og-image.png",
...(FLAGS.WORKSHOP ? ["/workshop"] : []),
];
},
} satisfies Config;