forked from marinaaisa/nuxt-markdown-blog-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuxt.config.js
128 lines (121 loc) · 4.28 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
const builtAt = new Date().toISOString()
const path = require('path')
const { I18N } = require('./locales/i18n-nuxt-config')
import blogsEn from './contents/en/blogsEn.js'
import blogsEs from './contents/es/blogsEs.js'
const productionUrl = {
en: "/en",
es: "/es"
};
const baseUrl = 'https://marinaaisa.com';
module.exports = {
env: {
baseUrl,
productionUrl
},
head: {
title: 'Marina Aisa | Product Designer & Front-end Developer',
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' },
{ name: 'msapplication-TileColor', content: '#ffffff' },
{ name: 'msapplication-TileImage', content: '/favicons/mstile-144x144.png' },
{ name: 'theme-color', content: '#c1c1c1' },
{ name: 'robots', content: 'index, follow' },
{ name: 'twitter:card', content: 'summary_large_image' },
{ name: 'twitter:site', content: '@marinaaisa' },
{ property: 'og:type', content: 'profile' },
{ property: 'og:updated_time', content: builtAt }
],
link: [
{ rel: 'icon', type: 'image/png', href: '/favicons/favicon-16x16.png', sizes: '16x16' },
{ rel: 'icon', type: 'image/png', href: '/favicons/favicon-32x32.png', sizes: '32x32' },
{ rel: 'icon', type: 'image/png', href: '/favicons/android-chrome-96x96.png', sizes: '96x96' },
{ rel: 'icon', type: 'image/png', href: '/favicons/android-chrome-192x192.png', sizes: '192x192' },
{ rel: 'apple-touch-icon', href: '/favicons/apple-touch-icon-57x57.png', sizes: '57x57' },
{ rel: 'apple-touch-icon', href: '/favicons/apple-touch-icon-60x60.png', sizes: '60x60' },
{ rel: 'apple-touch-icon', href: '/favicons/apple-touch-icon-72x72.png', sizes: '72x72' },
{ rel: 'apple-touch-icon', href: '/favicons/apple-touch-icon-76x76.png', sizes: '76x76' },
{ rel: 'apple-touch-icon', href: '/favicons/apple-touch-icon-114x114.png', sizes: '114x114' },
{ rel: 'apple-touch-icon', href: '/favicons/apple-touch-icon-120x120.png', sizes: '120x120' },
{ rel: 'apple-touch-icon', href: '/favicons/apple-touch-icon-144x144.png', sizes: '144x144' },
{ rel: 'apple-touch-icon', href: '/favicons/apple-touch-icon-152x152.png', sizes: '152x152' },
{ rel: 'apple-touch-icon', href: '/favicons/apple-touch-icon-180x180.png', sizes: '180x180' },
{ rel: 'mask-icon', type: 'image/png', href: '/favicons/safari-pinned-tab.svg', color: '#c1c1c1' },
{ rel: 'manifest', href: '/manifest.json' }
]
},
/*
** Customize the progress-bar color
*/
loading: {
color: '#5a46ff',
height: '3px'
},
/*
** Build configuration
*/
css: [
'normalize.css/normalize.css',
'@/assets/css/main.scss'
],
build: {
extend (config) {
const rule = config.module.rules.find(r => r.test.toString() === '/\\.(png|jpe?g|gif|svg|webp)$/i')
config.module.rules.splice(config.module.rules.indexOf(rule), 1)
config.module.rules.push({
test: /\.md$/,
loader: 'frontmatter-markdown-loader',
include: path.resolve(__dirname, 'contents'),
options: {
vue: {
root: "dynamicMarkdown"
}
}
}, {
test: /\.(jpe?g|png)$/i,
loader: 'responsive-loader',
options: {
placeholder: true,
quality: 60,
size: 1400,
adapter: require('responsive-loader/sharp')
}
}, {
test: /\.(gif|svg)$/,
loader: 'url-loader',
query: {
limit: 1000,
name: 'img/[name].[hash:7].[ext]'
}
});
}
},
plugins: ['~/plugins/lazyload', '~/plugins/globalComponents', { src: '~plugins/ga.js', ssr: false }],
modules: [
'@nuxtjs/style-resources',
['nuxt-i18n', I18N],
'nuxt-webfontloader'
],
styleResources: {
scss: [
'@/assets/css/utilities/_variables.scss',
'@/assets/css/utilities/_helpers.scss',
'@/assets/css/base/_grid.scss',
'@/assets/css/base/_buttons.scss'
],
},
webfontloader: {
custom: {
families: ['Graphik', 'Tiempos Headline'],
urls: ['/fonts/fonts.css']
}
},
generate: {
routes: [
'/es', '404'
]
.concat(blogsEn.map(w => `/blog/${w}`))
.concat(blogsEs.map(w => `es/blog/${w}`))
}
}