-
Notifications
You must be signed in to change notification settings - Fork 18
/
gatsby-config.js
98 lines (95 loc) · 2.78 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
95
96
97
98
const lost = require('lost')
const pxtorem = require('postcss-pxtorem')
const url = 'https://gatsby-starter-kontent-lumen.netlify.com/'
require('dotenv').config()
module.exports = {
// These properties are used by gatsby-plugin-sitemap
// https://www.gatsbyjs.org/packages/gatsby-plugin-sitemap/#how-to-use
siteMetadata: {
url,
siteUrl: url,
},
plugins: [
{
resolve: '@kentico/gatsby-source-kontent',
options: {
projectId: process.env.KONTENT_PROJECT_ID, // Fill in your Project ID
// if false used authorization key for secured API
usePreviewUrl: process.env.KONTENT_PREVIEW_ENABLED && process.env.KONTENT_PREVIEW_ENABLED.toLowerCase() === 'true',
authorizationKey: process.env.KONTENT_PREVIEW_ENABLED && process.env.KONTENT_PREVIEW_ENABLED.toLowerCase() === 'true'
? process.env.KONTENT_PREVIEW_KEY
: undefined,
languageCodenames: process.env.KONTENT_LANGUAGE_CODENAMES.split(',').map(lang => lang.trim()),
},
},
{
resolve: 'kontent-used-by-content-items', // local plugin
options: {
links: [
{
parentTypeCodename: 'article',
childTypeCodename: 'tag',
linkedElementCodename: 'tags',
backReferenceName: 'used_by_articles',
},
{
parentTypeCodename: 'article',
childTypeCodename: 'category',
linkedElementCodename: 'category',
backReferenceName: 'used_by_articles',
},
],
},
},
'gatsby-plugin-sharp',
{
resolve: 'gatsby-plugin-google-analytics',
options: { trackingId: '' }, // add own google analytics trackingId
},
{
resolve: 'gatsby-plugin-google-fonts',
options: {
fonts: ['roboto:400,400i,500,700'],
},
},
'gatsby-plugin-sitemap',
'gatsby-plugin-catch-links',
'gatsby-plugin-react-helmet',
{
resolve: 'gatsby-plugin-sass',
options: {
postCssPlugins: [
lost(),
pxtorem({
rootValue: 16,
unitPrecision: 5,
propList: [
'font',
'font-size',
'line-height',
'letter-spacing',
'margin',
'margin-top',
'margin-left',
'margin-bottom',
'margin-right',
'padding',
'padding-top',
'padding-left',
'padding-bottom',
'padding-right',
'border-radius',
'width',
'max-width',
],
selectorBlackList: [],
replace: true,
mediaQuery: false,
minPixelValue: 0,
}),
],
precision: 8,
},
},
],
}