-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathnuxt.config.ts
112 lines (108 loc) · 4.77 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
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
// site: {
// url: 'https://momo.gusibi.mobi',
// name: '古思乱讲'
// },
app: {
head: {
charset: 'utf-8',
viewport: 'width=device-width, initial-scale=1',
titleTemplate: '%s - 古思乱讲',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ name: 'format-detection', content: 'telephone=no' },
{
name: 'description',
content: '古思乱讲 - 一个关于技术、生活和思考的博客 一个简洁、现代的博客系统,灵感来源于 Path 应用的用户界面。它使用 GitHub Issues 作为 CMS,通过 Cloudflare Workers 提供 API 服务,并使用 Cloudflare Pages 进行静态网站托管。特点包括时间线式博客展示、Markdown 渲染、标签分类、反应统计、夜间模式和响应式设计。| A concise, modern blogging system inspired by the Path app. Using GitHub Issues as CMS and Cloudflare for efficient hosting. Features include timeline display, Markdown rendering, and tag categorization'
},
// Open Graph
{ property: 'og:description', content: '古思乱讲 - 一个关于技术、生活和思考的博客 简洁现代的博客系统,使用 GitHub Issues 作为 CMS,提供时间线式展示、Markdown 渲染、标签分类等功能。灵感源自 Path 应用,通过 Cloudflare 技术实现高效托管。| A concise, modern blogging system inspired by the Path app. Using GitHub Issues as CMS and Cloudflare for efficient hosting. Features include timeline display, Markdown rendering, and tag categorization' },
{ property: 'og:type', content: 'website' },
// Twitter Card
{ name: 'twitter:card', content: 'summary_large_image' },
{ name: 'twitter:description', content: '古思乱讲 - 一个关于技术、生活和思考的博客 简洁现代的博客系统,使用 GitHub Issues 作为 CMS,提供时间线式展示、Markdown 渲染、标签分类等功能。灵感源自 Path 应用,通过 Cloudflare 技术实现高效托管。| A concise, modern blogging system inspired by the Path app. Using GitHub Issues as CMS and Cloudflare for efficient hosting. Features include timeline display, Markdown rendering, and tag categorization' },
{ name: 'google-site-verification', content: 'mK8IcUVJNhs8X6Fwy-cJCB9AEIqxFbLOsKvynUoqa3Y' },
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
]
}
},
ssr: false,
compatibilityDate: '2024-04-03',
devtools: { enabled: true },
modules: ['@nuxtjs/tailwindcss', '@pinia/nuxt', '@stefanobartoletti/nuxt-social-share', '@nuxtjs/sitemap', '@nuxtjs/supabase', 'nuxt-gtag', 'nuxt-clarity-analytics'],
// configuration options
socialShare: {
baseUrl: 'https://momo.gusibi.mobi' // required!
// other optional module options
},
tailwindcss: {
cssPath: ["~/assets/css/tailwind.css", { injectPosition: 0 }],
configPath: 'tailwind.config.js',
exposeConfig: false,
injectPosition: 0,
viewer: true,
},
plugins: [
'~/plugins/marked.ts',
'~/plugins/head.ts',
'~/plugins/banner-content.ts',
],
routeRules: {
// 指定只有 /profile 路由需要身份验证
'/profile': { auth: true },
},
// 确保中间件被加载
hooks: {
'pages:extend'(pages) {
pages.forEach((page) => {
if (page.path === '/profile') {
page.meta = page.meta || {}
page.meta.middleware = ['auth']
}
})
}
},
runtimeConfig: {
public: {
apiBaseUrl: process.env.API_BASE_URL || 'https://path-memo-api.gusibi.mobi',
repoOwner: process.env.REPO_OWNER || 'gusibi',
repoName: process.env.REPO_NAME || 'path-meme-db',
perPageSize: process.env.PER_PAGE_SIZE || '10',
siteTitle: '古思乱讲',
siteDescription: '古思乱讲 - 一个关于技术、生活和思考的博客',
siteUrl: process.env.SITE_URL || 'https://momo.gusibi.mobi',
twitterHandle: '@yourtwitterhandle'
},
private: {
githubToken: process.env.GITHUB_TOKEN
}
},
gtag: {
id: 'G-N7EW8Y4SEF'
},
supabase: {
// Options
url: process.env.SUPABASE_URL,
key: process.env.SUPABASE_KEY,
serviceKey: process.env.SUPABASE_SERVICE_KEY,
redirect: false, // Redirect automatically to the configured login page if a non authenticated user is trying to access a guarded. You can disable all redirects by setting this option to false.
},
// Sitemap configuration
sitemap: {
// hostname: 'https://momo.gusibi.mobi',
// gzip: true,
exclude: [
'/admin/**'
],
sources: [
'/api/__sitemap__/urls'
]
},
nitro: {
preset: 'cloudflare-pages'
},
})