-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.ts
93 lines (90 loc) · 1.99 KB
/
nuxt.config.ts
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// https://nuxt.com/docs/api/configuration/nuxt-config
import { fileURLToPath, URL } from 'node:url';
import { description, name } from './package.json';
import { parseContent } from './server/utils/parseContent';
const contents = await parseContent(fileURLToPath(new URL('./content', import.meta.url)), { post: true });
const baseURL = '';
const posts = contents.map(v => `/post${v.path}`);
const tags = Array.from(new Set(contents.map(v => v.params.data.tags).flat(1))).filter(v => v).map(v => `/tag/${v}`);
export default defineNuxtConfig({
ssr: true,
modules: ['@nuxtjs/mdc', '@nuxt/ui'],
mdc: {},
experimental: {
payloadExtraction: false,
},
app: {
baseURL,
head: {
htmlAttrs: {
lang: 'zh-Hans',
},
},
},
future: {
// https://github.com/nuxt/nuxt/issues/29798#issuecomment-2466833928
compatibilityVersion: 4,
},
imports: {
dirs: [
],
},
runtimeConfig: {
content: fileURLToPath(new URL('./content', import.meta.url)),
public: {
title: name,
description,
nav: [{
text: '博客',
link: `/`,
}, {
text: '标签',
link: `/tag`,
}, {
text: '关于',
link: `/post/about`,
}, {
text: 'RSS',
link: `/api/rss.xml`,
options: {
open: {
target: '_blank',
},
},
}, {
icon: 'github',
link: `https://github.com/ckvv/${name}`,
options: {
open: {
target: '_blank',
},
},
}],
},
},
ui: {
fonts: false,
},
icon: {
customCollections: [{
prefix: 'custom',
dir: './assets/icons',
}],
},
compatibilityDate: '2024-04-03',
devtools: { enabled: false },
css: ['~/assets/css/main.css'],
vite: {
optimizeDeps: {
include: ['debug'],
},
css: {
transformer: 'lightningcss',
},
},
nitro: {
prerender: {
routes: [...posts, ...tags, `/api/rss.xml`],
},
},
});