-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuxt.config.js
131 lines (116 loc) · 3.85 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
require('dotenv').config();
const axios = require('axios')
module.exports = {
/*
** Headers of the page
*/
head: {
title: 'semana de informática 2018',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ name: 'theme-color', content: '#000000' },
{ hid: 'description', name: 'description', content: 'A Semana de Informática é um evento que decorre nos dias 29 de outubro a 1 de novembro, na Faculdade de Engenharia da Universidade do Porto, onde alunos vão poder passar 4 dias a aprender com especialistas nas diversas áreas de informática, familiarizar-se com o mundo empresarial e conviverem em competições e eventos sociais.' },
{ hid: 'keywords', name: 'keywords', keywords: 'informática, semana de informática, conferência, niaefeup, feup' },
{ property: 'og:title', content: 'semana de informática 2018' },
{ property: 'og:url', content: 'https://sinf.pt' },
{ property: 'og:image', content: 'https://sinf.pt/social-banner.png' },
],
link: [
{ rel: 'apple-touch-icon', sizes: "180x180", href: '/apple-touch-icon.png' },
{ rel: 'icon', type: 'image/png', sizes: "180x180", href: '/apple-touch-icon.png' },
{ rel: 'icon', type: 'image/png', sizes: "32x32", href: '/favicon-32x32.png' },
{ rel: 'icon', type: 'image/png', sizes: "16x16", href: '/favicon-16x16.png' },
{ rel: 'manifest', href: '/site.webmanifest' },
{ rel: 'mask-icon', href: '/safari-pinned-tab.svg', color: "#da291c" },
{ rel: 'shortcut icon', href: '/favicon.ico' },
{ rel: 'msapplication-TileColor', content: "#b91d47" },
{ rel: 'msapplication-config', content: "/browserconfig.xml" },
]
},
css: [
'@/assets/scss/custom.scss',
'node_modules/@fortawesome/fontawesome-free/css/all.css'
],
/*
** Customize the progress bar color
*/
loading: { color: '#3B8070' },
/*
** Build configuration
*/
build: {
vendor: ['bootstrap'],
/*
** Run ESLint on save
*/
extend (config, { isDev, isClient }) {
if (isDev && isClient) {
config.module.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /(node_modules)/
})
}
}
},
modules: [
// dotenv
'@nuxtjs/dotenv',
['@nuxtjs/google-analytics', {
id: process.env.GOOGLE_ANALYTICS_ID
}],
'nuxtent',
'nuxt-imagemin',
],
subFolders: false,
generate: {
routes: async function (callback) {
await axios.all([
axios.get('http://localhost:8080/content-api/talks'),
axios.get('http://localhost:8080/content-api/workshops'),
axios.get('http://localhost:8080/content-api/sessions')
])
.then(axios.spread(function (talks, workshops, sessions) {
let result = [];
for(let data of talks.data) {
if(data != null) {
result.push(data.path);
}
}
for(let data of workshops.data) {
if(data != null) {
result.push(data.path);
}
}
for(let data of sessions.data) {
if(data != null) {
result.push(data.path);
}
}
callback(null, result);
}), function(err) {
return next(err);
});
}
},
router: {
scrollBehavior(to, from, savedPosition) {
if (savedPosition) {
return savedPosition
} else {
let position = {}
if (to.matched.length < 2) {
position = { x: 0, y: 0 }
} else if (to.matched.some(r => r.components.default.options.scrollToTop)) {
position = { x: 0, y: 0 }
}
if (to.hash) {
position = { selector: to.hash }
}
return position
}
}
}
}