-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
nuxt.config.js
129 lines (119 loc) · 3.14 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
const path = require("path");
// markdown configration
import Mode from "frontmatter-markdown-loader/mode";
import MarkdownIt from "markdown-it";
const md = new MarkdownIt({
html: true,
typographer: true
});
// site config stuff
import fs from "fs";
import YAML from "yaml";
var file = fs.readFileSync("./siteConfig.yml", "utf8");
var siteConfig = YAML.parse(file);
var guides = siteConfig.guides
var routes = []
guides.forEach((slug) => {
routes.push(`/guides/${slug}`);
});
export default {
// for Now.sh hosting
// buildDir: 'dist',
server: {
port: 8000, // default: 3000
host: "0.0.0.0" // default: localhost
},
mode: "universal",
/*
** Headers of the page
*/
head: {
titleTemplate: "%s - " + siteConfig.title,
meta: [
{ charset: "utf-8" },
{ name: "viewport", content: "width=device-width, initial-scale=1" },
{
hid: "description",
name: "description",
content: siteConfig.desc
},
{ name: "theme-color", hid: "theme-color", content: "#000000" },
{ name: "twitter:title", content: "NextBus SG" },
{ name: "twitter:description", content: "A bus timings and public transport app for Singapore, with extra features" },
{ name: "twitter:image:src", content: "/social-preview.png" },
{ name: "twitter:site", content: "@themindstorm2" },
{ name: "twitter:card", content: "summary_large_image" },
{ property: "og:title", content: "NextBus SG" },
{ property: "og:description", content: "A bus timings and public transport app for Singapore, with extra features" },
{ property: "og:image", content: "/wa-preview.png" },
{ property: "og:url", content: "https://nextbus.now.sh/" },
],
link: [
{ rel: "icon", type: "image/x-icon", href: "/favicon.png" },
{
rel: "stylesheet",
href:
"https://fonts.googleapis.com/css2?family=Rubik:wght@400;700&display=swap"
}
]
},
/*
** Customize the progress-bar color
*/
loading: { color: "#000" },
/*
** Global CSS
*/
css: [],
/*
** Plugins to load before mounting the App
*/
plugins: ["~/plugins/globalComponents.js", "~/plugins/siteConfig.js"],
/*
** Nuxt.js dev-modules
*/
buildModules: [],
/*
** Nuxt.js modules
*/
modules: ["@nuxtjs/style-resources"],
styleResources: {
scss: ["assets/styles/variables.scss"]
},
/*
** Build configuration
*/
build: {
/*
** You can extend webpack config here
*/
extend(config, ctx) {
// for reading markdown files
config.module.rules.push(
{
test: /\.md$/,
loader: "frontmatter-markdown-loader",
// include: path.resolve(__dirname, 'content'),
options: {
mode: [Mode.VUE_RENDER_FUNCTIONS, Mode.VUE_COMPONENT, Mode.BODY],
vue: {
// root: "dynamicMarkdown"
},
markdown(body) {
return md.render(body);
}
}
},
{
test: /\.ya?ml$/,
type: "json",
use: "yaml-loader"
}
);
}
},
generate: {
dir: "dist",
routes: routes
}
};