-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnuxt.config.js
164 lines (159 loc) · 5.86 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
const axios = require('axios')
export default {
mode: 'universal',
/*
** Headers of the page
*/
head: {
title: `TSConf:EU - Europe's TypeScript Community Conference - 31th March 2020, Linz, Austria`,
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: process.env.npm_package_description || '' },
{ name: "msapplication-TileColor", content: "#ffffff"},
{ name: "msapplication-TileImage", content: "/images/ms-icon-144x144.png" },
{ name: "theme-color", content: "#ffffff" },
{ property: "og:image", content: "https://tsconf.eu/images/twittercard-ad.jpg" },
{ name: "twitter:card", content: "summary_large_image" },
{ name: "twitter:title", content: "TSConf:EU - A TypeScript conference for Europe" },
{ name: "twitter:image", content: "https://tsconf.eu/images/twittercard-ad.jpg" },
{ name: "twitter:creator", content: "@tsconfeu" },
],
link: [
{ rel: "manifest", href: "/manifest.json" },
{ rel: "apple-touch-icon", sizes: "57x57", href: "/images/apple-icon-57x57.png" },
{ rel: "apple-touch-icon", sizes: "60x60", href: "/images/apple-icon-60x60.png" },
{ rel: "apple-touch-icon", sizes: "72x72", href: "/images/apple-icon-72x72.png" },
{ rel: "apple-touch-icon", sizes: "76x76", href: "/images/apple-icon-76x76.png" },
{ rel: "apple-touch-icon", sizes: "114x11,4", href: "/images/apple-icon-114x114.png" },
{ rel: "apple-touch-icon", sizes: "120x12,0", href: "/images/apple-icon-120x120.png" },
{ rel: "apple-touch-icon", sizes: "144x14,4", href: "/images/apple-icon-144x144.png" },
{ rel: "apple-touch-icon", sizes: "152x15,2", href: "/images/apple-icon-152x152.png" },
{ rel: "apple-touch-icon", sizes: "180x18,0", href: "/images/apple-icon-180x180.png" },
{ rel: "icon", type: "image/png", sizes: "192x192", href: "/images/android-icon-192x192.png" },
{ rel: "icon", type: "image/png", sizes: "32x32", href: "/images/favicon-32x32.png" },
{ rel: "icon", type: "image/png", sizes: "96x96", href: "/images/favicon-96x96.png" },
{ rel: "icon", type: "image/png", sizes: "16x16", href: "/images/favicon-16x16.png" },
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
{ rel:'stylesheet', type: 'text/css', href: 'https://fonts.googleapis.com/css?family=Poppins:400,700&display=swap' }
]
},
/*
** Customize the progress-bar color
*/
loading: { color: '#fff' },
/*
** Global CSS
*/
css: [
],
/*
** Plugins to load before mounting the App
*/
plugins: [
'plugins/breakEachWord.ts',
'plugins/transformImage.ts',
'plugins/components.ts',
'plugins/url.ts'
],
/*
** Nuxt.js dev-modules
*/
buildModules: [
'@nuxt/typescript-build',
'@nuxtjs/tailwindcss'
],
/*
** Nuxt.js modules
*/
modules: [
['storyblok-nuxt', { accessToken: 'z7JV5HUxpNV10rvNaQ5n3Att', cacheProvider: 'memory' }],
['@nuxtjs/markdownit']
],
/*
** Build configuration
*/
build: {
/*
** You can extend webpack config here
*/
extend (config, ctx) {
}
},
/*
** Using generate to, well, generate our pages with this hidden little gem :)
*/
generate: {
routes: function (callback) {
const token = `z7JV5HUxpNV10rvNaQ5n3Att`
const version = 'published'
let cache_version = 0
function calculateLeft(release) {
const left = release.quantity - release.tickets_count
if(left > 15) {
return -1
}
return left
}
axios.get('https://api.tito.io/v3/scriptconf/tsconf-eu-2020/', {
headers: {
'Authorization': `Token token=${process.env.TITO_TOKEN}`,
'Content-Type': 'application/json'
}
}).then(data => {
try {
const titoTickets = data.data.event
.releases.filter(release => !release.secret)
.sort((a,b) => a.position - b.position)
.map(release => {
return {
title: release.title,
description: release.description,
slug: release.slug,
price: release.price,
url: release.share_url,
sold_out: release.sold_out,
left: calculateLeft(release)
}
})
let payload = {
tickets: titoTickets
}
// add routes manually or use the Links API of Storyblok to load all of them.
let routes = [
{ route: '/', payload },
{ route: '/code-of-conduct', payload },
{ route: '/faq', payload },
{ route: '/legal-notice', payload },
{ route: '/venue', payload },
{ route: '/schedule', payload },
{ route: '/workshops', payload },
{ route: '/workshops/advanced-type-level-programming-in-typescript', payload },
{ route: '/workshops/tdd-with-typescript', payload },
{ route: '/speakers', payload },
{ route: '/speakers/anders-hejlsberg', payload },
{ route: '/speakers/liliana-kastilio', payload },
{ route: '/speakers/bert-belder', payload },
{ route: '/speakers/max-heiber', payload },
{ route: '/speakers/nathalia-rus', payload },
{ route: '/speakers/natalie-marleny', payload },
{ route: '/speakers/peter-kroener', payload },
{ route: '/speakers/david-tanzer', payload },
{ route: '/speakers/johannes-rieken', payload },
{ route: '/speakers/fred-k-schott', payload },
]
// speakers, schedule, social
callback(null, routes)
} catch(e) {
callback(e)
}
})
},
},
/*
** Markdownit configurations
*/
markdownit: {
injected: true,
}
}