-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuxt.config.ts
111 lines (100 loc) · 2.37 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
const appName = "He's Blog";
const appDescription =
"A blog about frontend development, JavaScript, Vue, React.";
const appUrl = "https://phphe.com";
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
devtools: { enabled: true },
modules: [
"@nuxtjs/sitemap", // sitemap first
"@nuxt/content",
"@nuxtjs/tailwindcss",
"@nuxtjs/i18n",
"@nuxtjs/color-mode",
"@nuxtjs/google-fonts",
"nuxt-gtag",
"nuxt-disqus",
],
i18n: {
// vueI18n: "./i18n.config.ts",
locales: [
{
code: "en",
name: "English",
language: "en-US",
},
{
code: "zh",
name: "简体中文",
language: "zh-CN",
},
], // used in URL path prefix
defaultLocale: "en", // default locale of your project for Nuxt pages and routings
strategy: "prefix_except_default",
detectBrowserLanguage: false,
baseUrl: appUrl,
// https://github.com/nuxt-modules/i18n/issues/3238#issuecomment-2672492536
bundle: {
optimizeTranslationDirective: false,
},
},
content: {
// https://content.nuxt.com/get-started/configuration#highlight
// still need config 'pre' tag background color. I code it in layout file.
highlight: {
theme: {
// Default theme (same as single string)
default: "solarized-light",
// Theme used if `html.dark`
dark: "github-dark",
// Theme used if `html.sepia`
sepia: "monokai",
},
langs: [
// default, check https://content.nuxt.com/docs/getting-started/configuration#highlight
"json",
"js",
"ts",
"html",
"css",
"vue",
"shell",
"mdc",
"md",
"yaml",
// custom
"python",
"tsx",
],
},
},
colorMode: {
classSuffix: "", // no suffix, so color mode class will be `dark` or `light` in html tag
},
googleFonts: {
download: true,
families: {
Cairo: [400],
"Open+Sans": [300, 400, 500, 600, 700],
},
},
gtag: {
id: "G-GG17SFDKPV",
enabled: process.env.NODE_ENV === "production",
},
// @ts-ignore
disqus: {
shortname: "hes-blog-1",
},
site: {
url: appUrl,
name: appName,
},
runtimeConfig: {
public: {
appName,
appDescription,
},
},
compatibilityDate: "2025-01-04",
});