-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathnuxt.config.ts
More file actions
233 lines (215 loc) · 6.8 KB
/
Copy pathnuxt.config.ts
File metadata and controls
233 lines (215 loc) · 6.8 KB
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
import { defineNuxtConfig } from 'nuxt/config'
const YEAR = '2026'
const TITLE = 'COSCUP x UbuCon Asia 2026'
const TITLE_ZH = '開源人年會 x UbuCon Asia 2026'
const DESC = 'Conference for Open Source Coders, Users, and Promoters is a free annual conference providing a platform to connect FLOSS folks across Asia since 2006. It\'s a major force of free software movement advocacy in Taiwan.'
const URL = `https://coscup.org/${YEAR}`
const THEME_COLOR = '#2ac173'
const EVENT_COMMON = {
startDate: '2026-08-08T09:00:00+08:00',
endDate: '2026-08-09T17:00:00+08:00',
eventStatus: 'https://schema.org/EventScheduled',
eventAttendanceMode: 'https://schema.org/OfflineEventAttendanceMode',
inLanguage: ['zh-Hant-TW', 'en'],
location: {
'@type': 'Place',
'name': 'National Taiwan University of Science and Technology',
'sameAs': 'https://en.wikipedia.org/wiki/National_Taiwan_University_of_Science_and_Technology',
'address': {
'@type': 'PostalAddress',
'streetAddress': 'No. 43, Sec. 4, Keelung Road',
'addressLocality': 'Da\'an District',
'addressRegion': 'Taipei',
'postalCode': '106335',
'addressCountry': 'TW',
},
'geo': {
'@type': 'GeoCoordinates',
'latitude': 25.0137,
'longitude': 121.5405,
},
},
}
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
compatibilityDate: '2025-07-15',
devtools: { enabled: true },
css: ['~/assets/css/main.css'],
app: {
baseURL: '/2026',
head: {
title: TITLE,
titleTemplate: `%s | ${TITLE}`,
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/2026/favicon.svg' },
{ rel: 'apple-touch-icon', href: '/2026/pwa-apple-touch.png' },
],
meta: [
{ name: 'description', content: DESC },
{ name: 'theme-color', content: THEME_COLOR },
{ property: 'og:title', content: TITLE },
{ property: 'og:description', content: DESC },
{ property: 'og:site_name', content: TITLE },
{ property: 'og:type', content: 'website' },
{ name: 'twitter:card', content: 'summary_large_image' },
{ name: 'twitter:title', content: TITLE },
{ name: 'twitter:description', content: DESC },
{ name: 'twitter:site', content: '@coscup' },
],
script: [
{
type: 'application/ld+json',
textContent: JSON.stringify({
'@context': 'https://schema.org',
'@type': 'Event',
'name': TITLE,
'alternateName': TITLE_ZH,
'description': DESC,
'url': URL,
...EVENT_COMMON,
'isAccessibleForFree': true,
'image': [`${URL}/coscup_logo.png`],
'organizer': {
'@type': 'Organization',
'name': 'COSCUP',
'url': 'https://coscup.org/',
'sameAs': [
'https://en.wikipedia.org/wiki/COSCUP',
'https://www.wikidata.org/wiki/Q10846717',
],
},
'subEvent': {
'@type': 'Event',
'name': 'UbuCon Asia 2026',
'url': 'https://2026.ubucon.asia/',
...EVENT_COMMON,
},
}),
},
],
},
},
nitro: {
output: {
publicDir: process.env.NUXT_OUTPUT_DIR || '.output/public',
},
prerender: {
// Keep at 1: nuxt-og-image has a prerender race that 500s a random session
// _payload.json route under concurrency > 1. Raise only once that's fixed upstream.
concurrency: 1,
// ?session= is a client-side UI state (opens a session panel); prerendering those
// URLs is wasteful and bloats the build. Ignore them so the crawler doesn't follow
// the NuxtLinks in CpTrackSchedule that carry this query param.
ignore: [/\?/],
},
},
imports: {
scan: false,
},
typescript: {
typeCheck: true,
tsConfig: {
vueCompilerOptions: {
strictTemplates: true,
strictVModel: true,
strictCssModules: true,
checkUnknownProps: true,
checkUnknownEvents: true,
checkUnknownDirectives: true,
checkUnknownComponents: true,
target: 3.5,
},
},
},
modules: [
'@unocss/nuxt',
'@nuxt/content',
'@nuxt/eslint',
'@nuxt/fonts',
'@nuxt/image',
'@nuxt/icon',
'@nuxtjs/i18n',
'nuxt-gtag',
'nuxt-og-image',
'@vite-pwa/nuxt',
],
// Origin only — app.baseURL ('/2026') is appended automatically by nuxt-site-config.
site: {
url: 'https://coscup.org',
name: TITLE,
},
fonts: {
// global: true required so nuxt-og-image's renderer can use these fonts.
// Only weight 400: the Takumi renderer corrupts the 700-weight CJK glyphs
// (double-draw artifacts), so OG templates render CJK at regular weight.
// Order matters: Takumi picks one font per script run, so the widest-coverage
// CJK font (SC) must be first.
families: [
{ name: 'Noto Sans SC', weights: [400], global: true },
{ name: 'Noto Sans TC', weights: [400], global: true },
{ name: 'Noto Sans JP', weights: [400], global: true },
{ name: 'Noto Sans KR', weights: [400], global: true },
],
},
content: {
experimental: { nativeSqlite: true },
renderer: { anchorLinks: false },
},
eslint: {
config: { standalone: false },
},
icon: {
customCollections: [
{ prefix: 'local', dir: './app/assets/icons' },
],
class: 'icon',
},
i18n: {
// Match site.url so nuxt-site-config can build absolute hreflang/canonical links.
baseUrl: 'https://coscup.org',
locales: [
{ code: 'en', name: 'English', language: 'en-US' },
{ code: 'zh', name: '中文', language: 'zh-Hant-TW' },
],
defaultLocale: 'zh',
detectBrowserLanguage: false, // https://github.com/nuxt-modules/i18n/issues/3262
},
pwa: {
registerType: 'autoUpdate',
manifest: {
name: TITLE,
short_name: 'COSCUP 2026',
description: DESC,
lang: 'zh-Hant-TW',
theme_color: THEME_COLOR,
background_color: THEME_COLOR,
display: 'standalone',
icons: [
{ src: 'pwa-192.png', sizes: '192x192', type: 'image/png' },
{ src: 'pwa-512.png', sizes: '512x512', type: 'image/png' },
{ src: 'pwa-512-markable.png', sizes: '512x512', type: 'image/png', purpose: 'maskable' },
],
},
workbox: {
globPatterns: ['**/*.{js,css,html,png,svg,webp,woff2}'],
},
},
runtimeConfig: {
pretalxApiToken: '',
pretalxApiUrl: '',
googleSheetId: '',
baseUrl: URL,
},
vite: {
optimizeDeps: {
include: ['@vueuse/core', 'zod', 'leaflet'],
},
},
gtag: {
id: 'G-C9EMTMDSS1',
enabled: process.env.NODE_ENV === 'production',
config: {
page_title: 'COSCUP x UbuCon Asia 2026',
},
},
})