-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.js
134 lines (126 loc) · 4.84 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
import fs from 'fs';
import path from 'path';
const jsonData = dir => fs.readdirSync(path.join(__dirname, 'vendor', 'data', 'data', dir))
.map(file => file.match(/^(.+)\.json$/)[1])
.filter(file => !!file);
export default {
target: 'static',
head: {
htmlAttrs: { lang: 'en' },
title: 'BotBlock',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ name: 'mobile-web-app-capable', content: 'yes' },
{ name: 'apple-mobile-web-app-capable', content: 'yes' },
{ name: 'theme-color', content: '#29a3d0' },
{ hid: 'title', name: 'title', content: 'BotBlock' },
{ hid: 'description', name: 'description', content: 'BotBlock' },
{ hid: 'keywords', name: 'keywords', content: 'BotBlock' },
{ name: 'twitter:card', content: 'summary_large_image' },
{ name: 'twitter:site', content: '@BlockBotOrg' },
{ name: 'twitter:creator', content: '@MattIPv4' },
{ hid: 'twitter:title', name: 'twitter:title', content: 'BotBlock' },
{ hid: 'twitter:description', name: 'twitter:description', content: 'BotBlock' },
{ name: 'twitter:image', content: 'https://botblock.org/header.png' },
{ name: 'twitter:image:alt', content: 'BotBlock header image' },
{ hid: 'og:title', prefix: 'og: http://ogp.me/ns#', property: 'og:title', content: 'BotBlock' },
{ prefix: 'og: http://ogp.me/ns#', property: 'og:type', content: 'website' },
{ prefix: 'og: http://ogp.me/ns#', property: 'og:locale', content: 'en_GB' },
{ prefix: 'og: http://ogp.me/ns#', property: 'og:site_name', content: 'BotBlock' },
{ hid: 'og:description', prefix: 'og: http://ogp.me/ns#', property: 'og:description', content: 'BotBlock' },
{ hid: 'og:url', prefix: 'og: http://ogp.me/ns#', property: 'og:url', content: 'https://botblock.org' },
{ prefix: 'og: http://ogp.me/ns#', property: 'og:image', content: 'https://botblock.org/header.png' },
{ prefix: 'og: http://ogp.me/ns#', property: 'og:image:alt', content: 'BotBlock header image' },
],
link: [
{ rel: 'icon', type: 'image/png', href: 'https://botblock.org/icon.png' },
{ rel: 'shortcut-icon', type: 'image/png', href: 'https://botblock.org/icon.png' },
{ rel: 'apple-touch-icon', type: 'image/png', href: 'https://botblock.org/icon.png' },
{ hid: 'canonical', rel: 'canonical', href: 'https://botblock.org' },
],
},
loading: { color: '#29a3d0' },
css: [ 'modern-normalize' ],
modules: [ '@nuxtjs/sitemap' ],
buildModules: [ 'nuxt-resolve-url-loader' ],
generate: {
crawler: false,
fallback: '404.html',
subFolders: false,
routes: [
...jsonData('lists').map(list => `/lists/${list}`),
...jsonData('features').map(feature => `/features/${feature}`),
],
},
build: {
extend(config) {
config.module.rules.push({
test: /\.ya?ml$/,
type: 'json',
use: 'yaml-loader',
});
config.module.rules.push({
test: /\.md$/,
use: 'raw-loader',
});
config.module.rules.find(rule => rule.test.test('.svg')).test = /\.(png|jpe?g|gif|webp)$/;
config.module.rules.push({
test: /\.svg$/,
use: [
'babel-loader',
'vue-svg-loader',
],
});
},
},
sitemap: {
hostname: 'https://botblock.org',
routes: [
{
url: '',
priority: 1,
},
{
url: '/docs',
priority: 0.9,
},
{
url: '/docs/libraries',
priority: 0.8,
},
{
url: '/lists',
priority: 0.8,
},
{
url: '/features',
priority: 0.7,
},
...jsonData('lists').map(list => ({
url: `/lists/${list}`,
priority: 0.6,
})),
{
url: '/lists/best-practices',
priority: 0.5,
},
{
url: '/about',
priority: 0.5,
},
...jsonData('features').map(feature => ({
url: `/features/${feature}`,
priority: 0.4,
})),
{
url: '/lists/defunct',
priority: 0.3,
},
{
url: '/lists/hidden',
priority: 0.2,
},
],
},
};