rickvanlieshout.com/gatsby-config.js

192 lines
4.8 KiB
JavaScript
Raw Normal View History

2018-11-09 18:08:48 +01:00
'use strict';
const siteConfig = require('./config.js');
const postCssPlugins = require('./postcss-config.js');
2017-08-20 13:43:49 +02:00
module.exports = {
siteMetadata: {
2018-11-09 18:08:48 +01:00
url: siteConfig.url,
title: siteConfig.title,
subtitle: siteConfig.subtitle,
copyright: siteConfig.copyright,
disqusShortname: siteConfig.disqusShortname,
menu: siteConfig.menu,
author: siteConfig.author
2017-08-20 13:43:49 +02:00
},
plugins: [
{
resolve: 'gatsby-source-filesystem',
options: {
2018-11-09 18:08:48 +01:00
path: `${__dirname}/content`,
2017-08-20 13:43:49 +02:00
name: 'pages'
}
},
2019-01-21 13:31:32 +01:00
{
resolve: 'gatsby-source-filesystem',
options: {
path: `${__dirname}/static/media`,
name: 'media'
}
},
2018-11-09 20:20:44 +01:00
{
2018-11-11 12:19:06 +01:00
resolve: 'gatsby-source-filesystem',
2018-11-09 20:20:44 +01:00
options: {
2018-11-11 12:19:06 +01:00
name: 'assets',
2018-11-09 20:20:44 +01:00
path: `${__dirname}/static`
}
},
2017-08-20 13:43:49 +02:00
{
resolve: 'gatsby-plugin-feed',
options: {
query: `
{
site {
siteMetadata {
2018-02-12 00:14:51 +01:00
site_url: url
2017-08-20 13:43:49 +02:00
title
2018-02-12 00:14:51 +01:00
description: subtitle
2017-08-20 13:43:49 +02:00
}
}
}
`,
2018-11-09 18:08:48 +01:00
feeds: [{
serialize: ({ query: { site, allMarkdownRemark } }) => (
2019-01-21 15:18:15 +01:00
allMarkdownRemark.edges.map((edge) => Object.assign({}, edge.node.frontmatter, {
description: edge.node.frontmatter.description,
date: edge.node.frontmatter.date,
url: site.siteMetadata.site_url + edge.node.fields.slug,
guid: site.siteMetadata.site_url + edge.node.fields.slug,
custom_elements: [{ 'content:encoded': edge.node.html }]
}))
2018-11-09 18:08:48 +01:00
),
query: `
2017-08-20 13:43:49 +02:00
{
allMarkdownRemark(
limit: 1000,
sort: { order: DESC, fields: [frontmatter___date] },
2018-11-11 17:43:29 +01:00
filter: { frontmatter: { template: { eq: "post" }, draft: { ne: true } } }
2017-08-20 13:43:49 +02:00
) {
edges {
node {
html
fields {
slug
}
frontmatter {
title
date
2018-11-11 17:43:29 +01:00
template
2017-08-20 13:43:49 +02:00
draft
description
}
}
}
}
}
`,
2018-11-09 18:08:48 +01:00
output: '/rss.xml'
}]
2017-08-20 13:43:49 +02:00
}
},
{
resolve: 'gatsby-transformer-remark',
options: {
plugins: [
2019-02-14 23:41:24 +01:00
{
resolve: 'gatsby-remark-katex',
options: {
strict: 'ignore'
}
},
2017-08-20 13:43:49 +02:00
{
resolve: 'gatsby-remark-images',
2018-11-09 18:08:48 +01:00
options: { maxWidth: 960 }
2017-08-20 13:43:49 +02:00
},
{
resolve: 'gatsby-remark-responsive-iframe',
2018-01-21 01:03:59 +01:00
options: { wrapperStyle: 'margin-bottom: 1.0725rem' }
2017-08-20 13:43:49 +02:00
},
2019-02-15 22:56:55 +01:00
'gatsby-remark-autolink-headers',
2017-08-20 13:43:49 +02:00
'gatsby-remark-prismjs',
'gatsby-remark-copy-linked-files',
'gatsby-remark-smartypants'
]
}
},
'gatsby-transformer-sharp',
'gatsby-plugin-sharp',
2018-11-09 18:08:48 +01:00
'gatsby-plugin-netlify',
2017-08-20 13:43:49 +02:00
{
2018-11-09 18:08:48 +01:00
resolve: 'gatsby-plugin-netlify-cms',
2018-01-21 16:54:33 +01:00
options: {
2019-05-10 01:13:51 +02:00
modulePath: `${__dirname}/src/cms/index.js`,
2018-01-21 16:54:33 +01:00
}
},
2018-11-09 18:08:48 +01:00
{
resolve: 'gatsby-plugin-google-gtag',
options: {
trackingIds: [siteConfig.googleAnalyticsId],
pluginConfig: {
head: true,
},
},
2018-11-09 18:08:48 +01:00
},
2017-08-20 13:43:49 +02:00
{
resolve: 'gatsby-plugin-sitemap',
options: {
query: `
2018-11-09 18:08:48 +01:00
{
site {
siteMetadata {
2019-05-10 02:52:30 +02:00
siteUrl: url
2017-08-20 13:43:49 +02:00
}
2018-11-09 18:08:48 +01:00
}
allSitePage(
filter: {
path: { regex: "/^(?!/404/|/404.html|/dev-404-page/)/" }
}
) {
edges {
node {
path
2017-08-20 13:43:49 +02:00
}
}
2018-11-09 18:08:48 +01:00
}
}
`,
2017-08-20 13:43:49 +02:00
output: '/sitemap.xml',
2019-01-21 15:18:15 +01:00
serialize: ({ site, allSitePage }) => allSitePage.edges.map((edge) => ({
2019-05-10 02:52:30 +02:00
url: site.siteMetadata.siteUrl + edge.node.path,
2019-01-21 15:18:15 +01:00
changefreq: 'daily',
priority: 0.7
}))
2017-08-20 13:43:49 +02:00
}
},
{
resolve: 'gatsby-plugin-manifest',
options: {
name: siteConfig.title,
short_name: siteConfig.title,
start_url: '/',
background_color: '#FFF',
theme_color: '#F7A046',
display: 'standalone',
icon: 'static/photo.jpg'
},
},
2017-08-20 13:43:49 +02:00
'gatsby-plugin-offline',
'gatsby-plugin-catch-links',
'gatsby-plugin-react-helmet',
2018-11-09 18:08:48 +01:00
{
resolve: 'gatsby-plugin-sass',
options: {
postCssPlugins: [...postCssPlugins],
cssLoaderOptions: {
camelCase: false,
}
}
2019-04-08 17:53:56 +02:00
},
'gatsby-plugin-flow',
2017-08-20 13:43:49 +02:00
]
};