This repository has been archived by the owner on Aug 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
gatsby-config.js
executable file
·153 lines (152 loc) · 5.19 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
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
148
149
150
151
152
153
var netlifyCmsPaths = {
resolve: `gatsby-plugin-netlify-cms-paths`,
options: {
cmsConfig: `/static/admin/config.yml`,
},
}
module.exports = {
siteMetadata: {
title: "ctvrtkon.cz"
},
plugins: [
"gatsby-plugin-react-helmet",
"gatsby-plugin-sass",
{
resolve: "gatsby-source-filesystem",
options: {
path: `${__dirname}/src/pages`,
name: "pages"
}
},
{
resolve: "gatsby-source-filesystem",
options: {
path: `${__dirname}/static/img`,
name: "images"
}
},
"gatsby-plugin-sharp",
"gatsby-transformer-sharp",
{
resolve: "gatsby-transformer-remark",
options: {
plugins: [
netlifyCmsPaths,
{
resolve: `gatsby-remark-images`,
options: {
maxWidth: 820,
backgroundColor: "transparent"
}
}
]
}
},
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `Čtvrtkon.cz`,
short_name: `Čtvrtkon`,
start_url: `/`,
background_color: `#ffffff`,
theme_color: `#007CA3`,
display: `minimal-ui`,
icon: `static/img/icon-512x512.png`,
icons: [
{
"src": "static/img/icon-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "static/img/icon-256x256.png",
"sizes": "256x256",
"type": "image/png"
},
{
"src": "static/img/icon-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}
},
{
resolve: `gatsby-plugin-google-analytics`,
options: {
trackingId: "UA-132203623-1",
},
},
{
resolve: `gatsby-plugin-json-output`,
options: {
siteUrl: `https://ctvrtkon.cz`,
graphQLQuery: `
{
allMarkdownRemark(
sort: { order: DESC, fields: [frontmatter___date] },
filter: { frontmatter: { templateKey: { eq: "blog-post" } }},
limit: 20
) {
edges {
node {
excerpt(pruneLength: 300)
id
fields {
slug
}
frontmatter {
title
description
templateKey
image {
publicURL
}
time(formatString: "DD.MM.YYYY HH:mm"),
place
section
fbEventLink
}
}
}
}
}
`,
serialize: results => results.data.allMarkdownRemark.edges.map(({node}) => {
return {
path: node.fields.slug, // MUST contain a path
title: node.frontmatter.title,
image: node.frontmatter.image.publicURL,
place: node.frontmatter.place,
date: node.frontmatter.date,
section: node.frontmatter.section,
time: node.frontmatter.time,
id: node.id
}
}),
serializeFeed: results => results.data.allMarkdownRemark.edges.map(({node}) => {
return {
id: node.fields.slug,
url: 'https://ctvrtkon.cz' + node.fields.slug,
image: 'https://ctvrtkon.cz' + node.frontmatter.image.publicURL,
title: node.frontmatter.title,
description: node.frontmatter.description,
place: node.frontmatter.place,
section: node.frontmatter.section,
fbEventLink: node.frontmatter.fbEventLink,
time: node.frontmatter.time,
}
}),
nodesPerFeedFile: 100,
}
},
"gatsby-plugin-remove-serviceworker",
{
resolve: "gatsby-plugin-netlify-cms",
options: {
modulePath: `${__dirname}/src/cms/cms.js`
}
},
"gatsby-plugin-netlify" // make sure to keep it last in the array
]
};