-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuxt.config.ts
145 lines (132 loc) · 3.15 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
// https://nuxt.com/docs/api/configuration/nuxt-config
import process from 'node:process'
export default defineNuxtConfig({
site: {
url: 'https://jannchie.com',
name: 'Jannchie\'s Home',
},
imports: {
dirs: ['./composables', './utils', './data'],
},
devtools: {
enabled: true,
timeline: {
enabled: false,
},
},
app: {
pageTransition: { name: 'page', mode: 'out-in' },
},
experimental: {
// when using generate, payload js assets included in sw precache manifest
// but missing on offline, disabling extraction it until fixed
payloadExtraction: false,
// inlineSSRStyles: false,
renderJsonPayloads: true,
typedPages: true,
},
modules: ['@nuxt/content', '@nuxtjs/google-fonts', '@vite-pwa/nuxt', '@unocss/nuxt', '@vueuse/nuxt', 'nuxt-og-image'],
ogImage: {
fonts: [
'Noto+Sans+SC:400',
'Noto+Sans+SC:700',
'Noto+Sans+JP:400',
'Noto+Sans+JP:700',
],
},
content: {
build: {
pathMeta: {
slugifyOptions: {
lower: false,
},
},
markdown: {
highlight: {
langs: ['go', 'json', 'js', 'ts', 'html', 'css', 'vue', 'shell', 'mdc', 'md', 'yaml', 'jsx', 'tsx', 'rust', 'python', 'sql'],
theme: 'github-dark',
},
remarkPlugins: {
'remark-math': {},
},
rehypePlugins: {
'rehype-katex': {
output: 'html', // the default value is 'htmlAndMathml'
},
},
},
},
},
hooks: {
'content:file:beforeParse':(ctx)=> {
const {file} = ctx
if (file.id.endsWith('.md')) {
file.body = file.body.replace(/\r\n|\r/g, '\n')
}
}
},
mdc: {
highlight: {
theme: {
light: 'material-theme-lighter',
default: 'material-theme',
dark: 'material-theme-palenight',
},
},
},
googleFonts: {
preload: true,
prefetch: true,
families: {
'My Soul': true,
},
},
appConfig: {
buildDate: new Date().toISOString(),
},
pwa: {
disable: process.env.NODE_ENV === 'development',
mode: 'production',
registerType: 'autoUpdate',
manifest: {
name: 'Jannchie\'s',
short_name: 'Jannchie\'s',
theme_color: '#ffffff',
icons: [
{
src: 'imgs/jannchie-192.jpg',
sizes: '192x192',
type: 'image/png',
},
{
src: 'imgs/jannchie-512.jpg',
sizes: '512x512',
type: 'image/png',
},
{
src: 'imgs/jannchie-512.jpg',
sizes: '512x512',
type: 'image/png',
purpose: 'any maskable',
},
],
},
registerWebManifestInRouteRules: true,
writePlugin: true,
workbox: {
navigateFallback: '/',
navigateFallbackDenylist: [/^\/api\//],
cleanupOutdatedCaches: true,
globPatterns: ['**/*.{js,css,html,png,svg,ico}'],
},
client: {
installPrompt: true,
periodicSyncForUpdates: process.env.NODE_ENV === 'production' ? 3600 : 20,
},
devOptions: {
enabled: false,
navigateFallback: '/',
},
},
compatibilityDate: '2025-03-28',
})