-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.js
194 lines (179 loc) · 5.11 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
export default {
// Target: https://go.nuxtjs.dev/config-target
target: 'static',
router: {
extendRoutes(routes, resolve) {
const postListComp = resolve(__dirname, 'pages/blog/index.vue');
const postComp = resolve(__dirname, 'pages/blog/_slug.vue');
routes.length = 0;
routes.push({
path: '/',
component: postListComp,
name: '전체 보기',
});
routes.push({
path: '/tag',
component: postListComp,
});
function addCategory(path, name) {
routes.push({
path: '/' + path,
component: postListComp,
name,
});
routes.push({
path: '/' + path + '/:year/:month/:slug',
component: postComp,
name: name + '-slug',
});
}
addCategory('html', 'HTML');
addCategory('css', 'CSS');
addCategory('js', 'Javascript');
addCategory('vuejs', 'VueJS');
},
},
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
title: `블로그 꾸미고 노는 걸 좋아하는 프론트엔드 개발자`,
htmlAttrs: {
lang: 'ko',
},
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{
name: 'description',
content:
'열심히 살면서 블로그 꾸미는 거 좋아하고 돈 많이 벌고 싶은 프론트엔드 개발자입니다.',
},
{
hid: 'og:type',
property: 'og:type',
content: 'website',
},
{
hid: 'og:site_name',
property: 'og:site_name',
content: "MCLearning's blog",
},
{
hid: 'og:title',
property: 'og:title',
content: "Welcome to MCLearning's blog",
},
{
hid: 'og:description',
property: 'og:description',
content:
'열심히 살면서 블로그 꾸미는거 좋아하고 돈 많이 벌고 싶은 프론트엔드 개발자입니다.',
},
{
hid: 'og:image',
property: 'og:image',
content: 'https://mclearning.dev/logo.png',
},
{
hid: 'og:url',
property: 'og:url',
content: 'https://mclearning.dev/',
},
{
name: 'naver-site-verification',
content: process.env.NAVER_SITE_VERIFICATION,
},
{
name: 'google-site-verification',
content: process.env.GOOGLE_SITE_VERIFICATION,
},
],
link: [
{ rel: 'shortcut icon', type: 'image/x-icon', href: '/favicon.ico' },
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
{ rel: 'preconnect', href: 'https://fonts.gstatic.com' },
{
rel: 'stylesheet',
type: 'text/css',
href: 'https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@100;300;400;500;700;900&display=swap',
},
],
script: [
// gtag
{
async: true,
src: 'https://www.googletagmanager.com/gtag/js?id=G-VNY2TDSXKE',
},
],
},
// Global CSS: https://go.nuxtjs.dev/config-css
css: ['~/assets/scss/reset.scss', '~/assets/scss/common.scss'],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: ['~/plugins/async_data.js', '~/plugins/gtag.js'],
// Auto import components: https://go.nuxtjs.dev/config-components
components: true,
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [
// https://go.nuxtjs.dev/eslint
'@nuxtjs/eslint-module',
'@nuxtjs/style-resources',
],
styleResources: {
scss: ['~/assets/scss/abstract/*.scss'],
},
// Modules: https://go.nuxtjs.dev/config-modules
modules: [
// https://go.nuxtjs.dev/axios
'@nuxtjs/axios',
// https://go.nuxtjs.dev/content
'@nuxt/content',
// https://sitemap.nuxtjs.org/guide/setup
'@nuxtjs/sitemap',
// https://www.npmjs.com/package/@nuxtjs/robots
'@nuxtjs/robots',
'@nuxtjs/dotenv',
],
// Axios module configuration: https://go.nuxtjs.dev/config-axios
axios: {},
// Content module configuration: https://go.nuxtjs.dev/config-content
content: {
liveEdit: false,
markdown: {
prism: {
theme: false,
},
},
},
// Build Configuration: https://go.nuxtjs.dev/config-build
// https://stackoverflow.com/questions/51625767/how-to-make-a-compressed-js-files-with-all-pages-in-nuxt-js
// build: {
// optimization: {
// splitChunks: {
// chunks: 'async',
// },
// },
// splitChunks: {
// pages: false,
// vendor: false,
// commons: false,
// runtime: false,
// layouts: false,
// },
// },
// Sitemap Configuration: https://sitemap.nuxtjs.org/usage/sitemap
sitemap: {
hostname: 'https://mclearning.dev',
gzip: true,
defaults: {
priority: 1,
lastmod: new Date(),
},
},
generate: {
fallback: false,
async routes() {
const { $content } = require('@nuxt/content');
const files = await $content({ deep: true }).only(['path']).fetch();
return files.map((file) => (file.path === '/' ? '/' : file.path));
},
},
};