-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnuxt.config.ts
181 lines (178 loc) · 8.04 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
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
import { getIds } from './lib/event'
const pkg = require('./package')
const speakersPages = getIds().map((m) => { return `/speakers/${m}` })
const dynamicPages = speakersPages.concat([
'/speakers',
'/blog/thanks-bye',
'/blog/press-release',
'/blog/lunch-map',
'/blog/registration-is-open',
'/blog/schedule-and-speakers-are-published',
'/blog/sponsors-are-published',
'/blog/call-for-sponsors-is-open',
'/blog/call-for-sponsors-is-open',
'/blog/call-for-papers-is-open',
'/blog/brand-kit-releases',
'/blog/hello-gophers',
'/blog',
'/assets/gopher-noodle-for-phone',
'/assets/gopher-noodle-for-laptop',
'/assets/gopher-pattern-for-phone',
'/assets/gopher-pattern-for-laptop',
'/assets/gopher-sunglass-for-phone',
'/assets/gopher-sunglass-for-laptop'
])
const dynamicPagesWithLocale = dynamicPages.concat(dynamicPages.map((m) => { return `/ja${m}` }))
const config = {
mode: 'spa',
head: {
title: pkg.fullname,
titleTemplate: `%s - ${pkg.fullname}`,
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no' },
{ hid: 'description', name: 'description', content: pkg.description },
{ name: 'keywords', content: 'Go, Golang, Conference, GopherCon, Gopher, Fukuoka, 2019' },
{ property: 'og:title', content: pkg.fullname },
{ property: 'og:type', content: 'article' },
{ property: 'og:url', content: pkg.homepage },
{ property: 'og:image', content: `${pkg.homepage}/icons/ogimage.png` },
{ property: 'og:description', content: pkg.description },
{ property: 'og:site_name', content: pkg.fullname },
{ property: 'og:locale', content: 'ja_JP' },
{ property: 'twitter:card', content: 'summary_large_image' },
{ property: 'twitter:site', content: '@golangjp' },
{ property: 'twitter:title', content: pkg.fullname },
{ property: 'twitter:description', content: pkg.description },
{ property: 'twitter:url', content: pkg.homepage },
{ property: 'twitter:image', content: `${pkg.homepage}/icons/ogimage.png` },
// Icons generated: https://www.favicon-generator.org/
{ name: 'msapplication-TileColor', content: '#ffffff' },
{ name: 'msapplication-TileImage', content: '/icons/ms-icon-144x144.png' },
{ name: 'theme-color', content: '#ffffff' }
],
script: [
{ defer: 'defer', src: '//use.fontawesome.com/releases/v5.7.2/js/solid.js', integrity: 'sha384-6FXzJ8R8IC4v/SKPI8oOcRrUkJU8uvFK6YJ4eDY11bJQz4lRw5/wGthflEOX8hjL', crossorigin: 'anonymous' },
{ defer: 'defer', src: '//use.fontawesome.com/releases/v5.7.2/js/brands.js', integrity: 'sha384-zJ8/qgGmKwL+kr/xmGA6s1oXK63ah5/1rHuILmZ44sO2Bbq1V3p3eRTkuGcivyhD', crossorigin: 'anonymous' },
{ defer: 'defer', src: '//use.fontawesome.com/releases/v5.7.2/js/fontawesome.js', integrity: 'sha384-xl26xwG2NVtJDw2/96Lmg09++ZjrXPc89j0j7JHjLOdSwHDHPHiucUjfllW0Ywrq', crossorigin: 'anonymous' }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
{ rel: 'stylesheet', href: '//fonts.googleapis.com/css?family=Arvo:400,700' },
// Icons generated: https://www.favicon-generator.org/
{ rel: 'icon', type: 'image/png', sizes: '192x192', href: '/icons/android-icon-192x192.png' },
{ rel: 'icon', type: 'image/png', sizes: '32x32', href: '/icons/favicon-32x32.png' },
{ rel: 'icon', type: 'image/png', sizes: '96x96', href: '/icons/favicon-96x96.png' },
{ rel: 'icon', type: 'image/png', sizes: '16x16', href: '/icons/favicon-16x16.png' },
{ rel: 'apple-touch-icon', sizes: '57x57', href: '/icons/apple-icon-57x57.png' },
{ rel: 'apple-touch-icon', sizes: '60x60', href: '/icons/apple-icon-60x60.png' },
{ rel: 'apple-touch-icon', sizes: '72x72', href: '/icons/apple-icon-72x72.png' },
{ rel: 'apple-touch-icon', sizes: '76x76', href: '/icons/apple-icon-76x76.png' },
{ rel: 'apple-touch-icon', sizes: '114x114', href: '/icons/apple-icon-114x114.png' },
{ rel: 'apple-touch-icon', sizes: '120x120', href: '/icons/apple-icon-120x120.png' },
{ rel: 'apple-touch-icon', sizes: '144x144', href: '/icons/apple-icon-144x144.png' },
{ rel: 'apple-touch-icon', sizes: '152x152', href: '/icons/apple-icon-152x152.png' },
{ rel: 'apple-touch-icon', sizes: '180x180', href: '/icons/apple-icon-180x180.png' },
// Splash images: https://qiita.com/NaokiIshimura/items/2b18ce82c936399b695c
// https://developer.apple.com/design/human-interface-guidelines/ios/icons-and-images/launch-screen/
{ rel: 'apple-touch-startup-image', href: '/splash/640x1136.png', media: '(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)' },
{ rel: 'apple-touch-startup-image', href: '/splash/750x1334.png', media: '(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)' },
{ rel: 'apple-touch-startup-image', href: '/splash/1242x2208.png', media: '(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)' },
{ rel: 'apple-touch-startup-image', href: '/splash/1125x2436.png', media: '(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)' },
{ rel: 'apple-touch-startup-image', href: '/splash/1536x2048.png', media: '(min-device-width: 768px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait)' },
{ rel: 'apple-touch-startup-image', href: '/splash/1668x2224.png', media: '(min-device-width: 834px) and (max-device-width: 834px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait)' },
{ rel: 'apple-touch-startup-image', href: '/splash/2048x2732.png', media: '(min-device-width: 1024px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait)' }
]
},
loading: { color: '#666' },
css: [],
plugins: [
{ src: '~plugins/redirect-ssl', ssr: false },
{ src: '~plugins/pattern-wall', ssr: false },
{ src: '~plugins/scroll', ssr: false },
{ src: '~plugins/parallax', ssr: false },
{ src: '~plugins/lazyload', ssr: false },
{ src: '~plugins/googlemap', ssr: false },
{ src: '~plugins/gallery', ssr: false }
],
modules: [
['nuxt-imagemin'],
['@nuxtjs/google-analytics', { id: 'UA-328462-17' }],
['nuxt-i18n', {
seo: false,
parsePages: false,
locales: [
{ name: 'English', code: 'en', iso: 'en-US', file: 'en.ts' },
{ name: '日本語', code: 'ja', iso: 'ja_JP', file: 'ja.ts' }
],
lazy: true,
langDir: 'lang/',
defaultLocale: 'en',
detectBrowserLanguage: {
useCookie: true,
cookieKey: 'i18n_redirected',
// keep their selected a locale
alwaysRedirect: true,
fallbackLocale: 'en'
},
vueI18n: {
fallbackLocale: 'en'
},
vueI18nLoader: true,
silentTranslationWarn: true
}],
'@nuxtjs/markdownit',
'@nuxtjs/axios',
'@nuxtjs/bulma',
'@nuxtjs/pwa'
],
router: {
middleware: [
'gopher',
'trailing-slash'
]
},
// See https://github.com/markdown-it/markdown-it
markdownit: {
preset: 'default',
linkify: false,
breaks: true,
injected: true
},
axios: {
},
generate: {
dir: 'dist',
fallback: true,
subFolders: true,
routes: dynamicPagesWithLocale
},
transpile: [/^vue2-google-maps($|\/)/],
build: {
extend(c: any) {
c.module.rules.push({
resourceQuery: /blockType=i18n/,
type: 'javascript/auto',
loader: ['@kazupon/vue-i18n-loader', 'yaml-loader'],
})
// 5MB
c.performance.maxAssetSize = 5000000
},
postcss: {
plugins: {
'postcss-preset-env': {
features: {
customProperties: false
}
}
},
preset: {
features: {
customProperties: false
}
}
}
}
}
// @ts-ignore: for editor
export = config