-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathnuxt.config.js
45 lines (42 loc) · 1.2 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
export default {
head: {
titleTemplate: `%s - Content`,
title: 'Content',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: `How to use Nuxt Content and Components in your website` }
],
link: [
// Demo for adding a google font (INTER UI)
{
rel: 'stylesheet',
href:
'https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap'
}
]
},
buildModules: ["@nuxt/components"],
components: true,
modules: [
'@nuxt/content',
'@nuxtjs/style-resources',
],
// import screen size mixin in all components
styleResources: {
scss: [
'assets/styles/screen.scss',
]
},
generate: {
async routes () {
// next comment to make VSCode ignore the "error"
// @ts-ignore
const { $content } = require('@nuxt/content')
const pages = await $content().only(['path']).fetch()
const posts = await $content('posts').only(['path']).fetch()
const files = [...pages,...posts,]
return files.map(file => file.path === '/index' ? '/' : file.path)
}
}
}