rickvanlieshout.com/gatsby-config.js

162 lines
4.1 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'
}
},
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 } }) => (
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 }]
}))
),
query: `
2017-08-20 13:43:49 +02:00
{
allMarkdownRemark(
limit: 1000,
sort: { order: DESC, fields: [frontmatter___date] },
filter: { frontmatter: { layout: { eq: "post" }, draft: { ne: true } } }
) {
edges {
node {
html
fields {
slug
}
frontmatter {
title
date
layout
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: [
{
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
},
'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: {
2018-11-09 18:08:48 +01:00
modulePath: `${__dirname}/src/cms/cms.js`,
2018-01-21 16:54:33 +01:00
}
},
2018-11-09 18:08:48 +01:00
{
resolve: 'gatsby-plugin-google-analytics',
options: { trackingId: siteConfig.googleAnalyticsId }
},
2017-08-20 13:43:49 +02:00
{
resolve: 'gatsby-plugin-sitemap',
options: {
query: `
2018-11-09 18:08:48 +01:00
{
site {
siteMetadata {
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',
serialize: ({ site, allSitePage }) =>
2018-11-09 18:08:48 +01:00
allSitePage.edges.map((edge) => ({
url: site.siteMetadata.url + edge.node.path,
changefreq: 'daily',
priority: 0.7
}))
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,
}
}
}
2017-08-20 13:43:49 +02:00
]
};