-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuxt.config.ts
141 lines (127 loc) · 2.76 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
import { defineConfig, searchForWorkspaceRoot } from 'vite'
const urlSchema = process.env.URL_SCHEMA || 'http'
const urlDomain = process.env.URL_DOMAIN || 'localhost:3000'
const urlBase = `${urlSchema}://${urlDomain}`
export default defineNuxtConfig({
// Nuxt
app: {
head: {
link: [
{ rel: 'icon', type: 'image/svg+xml', href: '/favicon.svg' },
],
},
},
devtools: {
enabled: process.env.DEVTOOLS !== '0',
},
css: [
'@/assets/css/main.sass',
'@/assets/css/common.sass',
],
modules: [
'@nuxtjs/color-mode',
// Must be included before content module
'nuxt-content-assets',
'@nuxt/content',
'@unocss/nuxt',
'@vueuse/nuxt',
'nuxt-anchorscroll',
'nuxt-feedme',
],
runtimeConfig: {
public: {
urlSchema,
urlDomain,
urlBase,
},
},
// Modules
colorMode: {
classSuffix: '',
classPrefix: '',
fallback: 'light',
preference: 'system',
},
// ContentAssets: https://nuxt.com/modules/content-assets#configuration
contentAssets: {
imageSize: 'src',
},
// Content: https://content.nuxtjs.org/api/configuration/
content: {
highlight: {
preload: [
'js',
'ts',
],
theme: {
default: 'vitesse-light',
dark: 'vitesse-dark',
},
},
markdown: {
remarkPlugins: [
'remark-heading-id',
],
},
},
feedme: {
feeds: {
'/feed.atom': { content: true },
'/feed.json': { content: true },
'/feed.xml': { content: true },
},
content: {
feed: {
defaults: {
title: 'Helltraitor',
description: 'Personal blog site',
copyright: 'CC BY-NC-SA 4.0 2023 by Helltraitor',
link: urlBase,
id: urlBase,
author: { email: 'helltraitor@hotmail.com', name: 'Helltraitor' },
},
},
item: {
defaults: {
author: [
{ email: 'helltraitor@hotmail.com', name: 'Helltraitor' },
],
},
mapping: [
['date', 'modified', value => value ? new Date(value) : value],
['date', 'created', value => value ? new Date(value) : value],
['date', '', () => new Date()],
['link', '_path'],
],
query: {
limit: 100,
where: [
{ _path: /^\/posts\/[^\/]+$/ },
],
},
},
tags: [
[/^(?=\/)/, urlBase],
],
},
},
typescript: {
strict: true,
},
// UnoCSS: See file
unocss: {
configFile: 'unocss.config.ts',
},
// Vite
vite: {
server: {
fs: {
allow: [
searchForWorkspaceRoot(process.cwd()),
'node_modules',
],
},
},
},
compatibilityDate: '2025-01-01',
})