-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuxt.config.js
117 lines (90 loc) · 2.98 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
const StoryblokClient = require('storyblok-js-client');
const storyblok = new StoryblokClient({ accessToken: process.env.STORYBLOK_AUTH_TOKEN })
module.exports = {
target: "static",
telemetry: false,
// Global page headers (https://go.nuxtjs.dev/config-head)
head: {
htmlAttrs: { dir: 'rtl' },
title: 'almarj3',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ name: "msapplication-TileColor", content: "#da532c" },
{ name: "theme-color", content: "#ffffff" }
],
link: [
{ rel: "apple-touch-icon", sizes: "180x180", href: "/favicons/apple-touch-icon.png" },
{ rel: "icon", type: "image/png", sizes: "32x32", href: "/favicons/favicon-32x32.png" },
{ rel: "icon", type: "image/png", sizes: "16x16", href: "/favicons/favicon-16x16.png" },
{ rel: "mask-icon", href: "/favicons/safari-pinned-tab.svg", color: "#5bbad5" },
]
},
// Global CSS (https://go.nuxtjs.dev/config-css)
css: [
'@/assets/fonts/Cairo/load.css',
'@/assets/main.css'
],
// Plugins to run before rendering page (https://go.nuxtjs.dev/config-plugins)
plugins: [
'@/plugins/algolia.plugin.js',
'@/plugins/prefers-color-mode.plugin.client.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://github.com/nuxt-community/svg-module#readme
'@nuxtjs/svg',
// https://go.nuxtjs.dev/eslint
['@nuxtjs/eslint-module', {
fix : true
}]
],
// Modules (https://go.nuxtjs.dev/config-modules)
modules: [
// Axios module configuration (https://go.nuxtjs.dev/config-axios)
'@nuxtjs/axios',
// https://github.com/storyblok/storyblok-nuxt
['storyblok-nuxt', {
accessToken: process.env.STORYBLOK_AUTH_TOKEN
}],
// https://go.nuxtjs.dev/pwa
'@nuxtjs/pwa',
// https://github.com/nuxt-community/sitemap-module#readme
['@nuxtjs/sitemap', {
hostname: process.env.BASE_URL,
i18n: true,
async routes () {
const { data: { stories : articles } } = await storyblok.get(`cdn/stories`);
return articles.map( article => ({
url: `/docs/${article.id}/${article.slug}`,
changefreq: 'daily',
priority: 0.7,
lastmod: article.published_at
}))
}
}]
],
axios : {
baseURL: process.env.BASE_URL
},
publicRuntimeConfig : {
ALGOLIA_APP_ID: process.env.ALGOLIA_APP_ID,
ALGOLIA_ADMIN_API_KEY: process.env.ALGOLIA_ADMIN_API_KEY
},
// Build Configuration (https://go.nuxtjs.dev/config-build)
build: {
},
// https://nuxtjs.org/docs/2.x/directory-structure/middleware
router: {},
reference: {
homePage : 'get-started/intro'
},
serverMiddleware: [
{ path: '/hooks/article-published', handler: '~/hooks/article-published.hook' }
],
generate: {
fallback: true
}
}