-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.js
144 lines (131 loc) · 3.48 KB
/
nuxt.config.js
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
import {createClient} from "./plugins/contentful";
import slug from 'slug'
import _ from 'lodash'
export default {
target: 'static',
head: {
titleTemplate: (pageTitle) => {
const siteTitle = '#ESNCZ20 | ESN Czech Republic';
// If undefined or blank then we don't need the hyphen
return pageTitle ? `${pageTitle} – ${siteTitle}` : `${siteTitle}`;
},
htmlAttrs: {
lang: 'en'
},
meta: [
{charset: 'utf-8'},
{name: 'viewport', content: 'width=device-width, initial-scale=1'},
{name: 'description', content: 'Celebrations of 20 years of ESN in the Czech Republic'},
{name: 'author', content: 'ESN Brno United & ISC CTU in Prague'},
{
name: 'keywords',
content: '20, 20 years, erasmus, erasmus student network, czech republic, isc ctu in prague, esn vse prague, #esncz20'
},
{name: 'format-detection', content: 'telephone=no,date=no,email=no'},
{name: 'google-site-verification', content: '5J3DG_xFC40IwbDml8YEsQtdSZpKc-FMtJ4CXGmv_nA'},
],
link: [
{rel: 'icon', type: 'image/x-icon', href: process.env.NUXT_ROUTER_BASE_URL + 'icon.png'}
]
},
css: [
'@/assets/css/main.css',
],
plugins: [
{src: '~/plugins/pwa-update.js', mode: 'client'},
],
components: true,
buildModules: [
'@nuxtjs/tailwindcss',
'@nuxtjs/dotenv',
'@nuxtjs/pwa',
],
modules: [
'@nuxtjs/axios',
['nuxt-leaflet', { /* module options */}],
'@nuxtjs/color-mode',
'@nuxtjs/gtm',
'@nuxtjs/markdownit',
'~/modules/write-version.js',
'@nuxtjs/sitemap',
],
axios: {
// Workaround to avoid enforcing hard-coded localhost:3000: https://github.com/nuxt-community/axios-module/issues/308
baseURL: process.env.FULL_BASE_URL || '/',
prefix: process.env.NUXT_ROUTER_BASE_URL || '/',
},
build: {
extend(config, {isDev, isClient}) {
// config.module.rules.push(
// {
// enforce: 'pre',
// test: /\.gpx/i,
// use: 'raw-loader',
// }
// )
}
},
router: {
base: process.env.NUXT_ROUTER_BASE_URL || '/'
},
pwa: {
meta: {
theme_color: '#2e3192',
name: '#ESNCZ20',
author: 'ESN Brno United & ISC CTU in Prague',
ogHost: process.env.FULL_BASE_URL || 'http://localhost:3000/',
ogImage: {
path: 'og-image.png',
width: 1921,
height: 1080,
}
},
manifest: {
name: '#ESNCZ20',
short_name: '#ESNCZ20',
display: 'standalone',
},
icon: {
purpose: 'any',
},
workbox: {
// enabled: false,
offline: false,
// offlineStrategy: "StaleWhileRevalidate",
}
},
generate: {
fallback: true,
async routes() {
const client = createClient();
const events = await client.getEntries({
content_type: 'event',
});
const questions = await client.getEntries({
content_type: 'faq',
});
return [
...events.items.map(i => `/event/${i.sys.id}`),
..._.uniq(questions.items.map(i => `/faq/${slug(i.fields.category)}`)),
...questions.items.map(i => `/faq/${slug(i.fields.category)}/${i.sys.id}`)
]
}
},
colorMode: {
classSuffix: ''
},
gtm: {
id: 'GTM-595F8QZ',
pageTracking: true,
},
markdownit: {
runtime: true,
preset: 'default',
linkify: true,
breaks: true,
},
sitemap: process.env.FULL_BASE_URL ? {
hostname: process.env.FULL_BASE_URL,
gzip: true,
} : false
}