-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.js
147 lines (134 loc) · 4.57 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
// Some properties reused in the OpenGraph tags.
var metas = {
title: 'Northern Climate Reports',
description:
'Warming temperatures, thawing permafrost, and more wildfires are changing landscapes across the North. Explore these changes with easy-to-understand climate model projections.',
preview: '/preview.png',
url: 'https://northernclimatereports.org',
}
// NuxtJS Config object!
export default {
// Target: https://go.nuxtjs.dev/config-target
target: 'static',
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
title: 'Northern Climate Reports for Changing Arctic Ecosystems',
htmlAttrs: {
lang: 'en',
},
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: '' },
{ itemprop: 'name', content: metas.title },
{ itemprop: 'description', content: metas.description },
{ itemprop: 'image', content: metas.preview },
{ name: 'twitter:card', content: 'summary_large_image' },
{ name: 'twitter:site', content: '@SNAPandACCAP' },
{ name: 'twitter:title', content: metas.title },
{ name: 'twitter:description', content: metas.description },
{ name: 'twitter:creator', content: '@SNAPandACCAP' },
{ name: 'twitter:image', content: metas.url + metas.preview },
{ property: 'og:title', content: metas.title },
{ property: 'og:type', content: 'website' },
{ property: 'og:url', content: metas.url },
{ property: 'og:image', content: metas.preview },
{ property: 'og:description', content: metas.description },
{ property: 'og:site_name', content: metas.title },
],
link: [
{
rel: 'icon',
type: 'image/png',
sizes: '16x16',
href: '/favicon-16x16.png',
},
{
rel: 'icon',
type: 'image/png',
sizes: '32x32',
href: '/favicon-32x32.png',
},
{ rel: 'manifest', href: '/site.webmanifest' },
],
},
// Global CSS: https://go.nuxtjs.dev/config-css
// Main is the entrypoint for all SCSS in our app.
css: ['@/assets/scss/main.scss', '@/assets/scss/minimaps.scss'],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [
'~/plugins/plotly.client',
'~/plugins/leaflet.client.js',
'~/plugins/vuex-router-sync',
'~/plugins/axios',
],
// Auto import components: https://go.nuxtjs.dev/config-components
components: true,
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [],
// Modules: https://go.nuxtjs.dev/config-modules
modules: [
// https://go.nuxtjs.dev/buefy
// We're doing a custom build, so don't include
// the pre-generated CSS.
['nuxt-buefy', { css: false }],
// https://go.nuxtjs.dev/axios
'@nuxtjs/axios',
// https://go.nuxtjs.dev/content
'@nuxt/content',
// https://www.npmjs.com/package/nuxt-leaflet
'nuxt-leaflet',
'@nuxt/http',
'nuxt-umami',
],
// Axios module configuration: https://go.nuxtjs.dev/config-axios
axios: {},
// Content module configuration: https://go.nuxtjs.dev/config-content
content: {},
// Build Configuration: https://go.nuxtjs.dev/config-build
build: {},
// Env vars
env: {
geoserverUrl:
process.env.GEOSERVER_URL || 'https://gs.mapventure.org/geoserver/wms',
rasdamanUrl:
process.env.RASDAMAN_URL || 'https://maps.earthmaps.io/rasdaman/ows',
apiUrl: process.env.SNAP_API_URL || 'https://earthmaps.io',
localStorageExpiration: 4,
offline: process.env.SITE_OFFLINE?.toLowerCase() == 'true',
},
// Router customizations
router: {
extendRoutes(routes, resolve) {
// Order matters here; lat/lng needs to go last because it's "globby"
routes.push({
path: '/report/community/:communityId',
component: resolve(__dirname, 'pages/index'),
})
routes.push({
path: '/report/area/:areaId',
component: resolve(__dirname, 'pages/index'),
})
routes.push({
path: '/search/:lat/:lng',
component: resolve(__dirname, 'pages/index'),
})
routes.push({
path: '/report/:lat/:lng',
component: resolve(__dirname, 'pages/index'),
})
routes.push({
name: 'default',
path: '*',
redirect: '/',
})
},
},
umami: {
scriptUrl: 'https://umami.snap.uaf.edu/script.js',
websiteId: '2e69a077-ba5f-49c5-b076-09a44ab6fafd',
ignoreDnt: false,
domains: 'northernclimatereports.org',
ignoreLocalhost: true,
},
}