-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgatsby-config.js
94 lines (94 loc) · 2.68 KB
/
gatsby-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
require('dotenv').config({
path: `.env.${process.env.NODE_ENV}`
})
module.exports = {
siteMetadata: {
title: `Statement Festival`,
description: `We are back`,
author: `ep`
},
plugins: [
`gatsby-plugin-react-helmet`,
{
resolve: `gatsby-source-filesystem`,
options: {
name: `assets`,
path: `${__dirname}/src/assets`
}
},
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `Statement Festival`,
short_name: `Statement`,
start_url: `/`,
background_color: `#5C1951`,
theme_color: `#FFF800`,
display: `minimal-ui`,
icon: `src/assets/statement-icon.png`
}
},
{
resolve: `gatsby-plugin-postcss`,
options: {
postCssPlugins: [
require(`postcss-preset-env`)({
stage: 1,
importFrom: 'src/styles/global.css'
})
]
}
},
{
resolve: 'gatsby-source-prismic',
options: {
repositoryName: 'statement',
accessToken: process.env.PRISMIC_API_KEY,
schemas: {
artist: require('./src/schemas/artist.json'),
homepage: require('./src/schemas/homepage.json'),
lineup: require('./src/schemas/lineup.json'),
page: require('./src/schemas/page.json'),
schedule: require('./src/schemas/schedule.json'),
website: require('./src/schemas/website.json'),
eventhomepage: require('./src/schemas/eventhomepage.json'),
eventpage: require('./src/schemas/eventpage.json')
},
prismicToolbar: true,
linkResolver: ({ node, key, value }) => (doc) => {
// TODO: Make sure that event_link exists
if (doc.type === 'artist') return `/line-up/${doc.uid}`
if (doc.type === 'schedule') return `/${doc.uid}`
if (doc.type === 'page') return `/${doc.uid}`
if (doc.type === 'lineup') return `/${doc.uid}`
if (doc.type === 'eventhomepage') return `/${doc.uid}`
if (doc.type === 'eventpage') {
let parent = 'event'
if (doc.data && doc.data.event_link) {
parent = doc.data.event_link.uid
}
return `/${parent}/${doc.uid}`
}
return '/'
}
}
},
{
resolve: 'gatsby-plugin-zopfli',
options: {
extensions: ['css', 'html', 'js', 'svg']
}
},
`gatsby-plugin-offline`,
{
resolve: `gatsby-plugin-gdpr-cookies`,
options: {
facebookPixel: {
pixelId: process.env.FACEBOOK_PIXEL_ID,
cookieName: 'statement-gdpr-facebook-pixel'
},
environments: ['production']
}
}
]
}