2018-11-09 20:08:48 +03:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const siteConfig = require('./config.js');
|
|
|
|
const postCssPlugins = require('./postcss-config.js');
|
|
|
|
|
2017-08-20 14:43:49 +03:00
|
|
|
module.exports = {
|
2019-07-02 17:25:14 -07:00
|
|
|
pathPrefix: siteConfig.pathPrefix,
|
2017-08-20 14:43:49 +03:00
|
|
|
siteMetadata: {
|
2018-11-09 20:08:48 +03: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 14:43:49 +03:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
{
|
|
|
|
resolve: 'gatsby-source-filesystem',
|
|
|
|
options: {
|
2020-09-10 00:42:30 +03:00
|
|
|
path: `${__dirname}/static`,
|
|
|
|
name: 'assets'
|
2017-08-20 14:43:49 +03:00
|
|
|
}
|
|
|
|
},
|
2019-01-21 15:31:32 +03:00
|
|
|
{
|
|
|
|
resolve: 'gatsby-source-filesystem',
|
|
|
|
options: {
|
|
|
|
path: `${__dirname}/static/media`,
|
|
|
|
name: 'media'
|
|
|
|
}
|
|
|
|
},
|
2019-07-19 20:42:20 +03:00
|
|
|
{
|
|
|
|
resolve: 'gatsby-source-filesystem',
|
|
|
|
options: {
|
2020-09-10 00:42:30 +03:00
|
|
|
path: `${__dirname}/content`,
|
|
|
|
name: 'pages'
|
2019-07-19 20:42:20 +03:00
|
|
|
}
|
|
|
|
},
|
2018-11-09 22:20:44 +03:00
|
|
|
{
|
2018-11-11 14:19:06 +03:00
|
|
|
resolve: 'gatsby-source-filesystem',
|
2018-11-09 22:20:44 +03:00
|
|
|
options: {
|
2020-09-10 00:42:30 +03:00
|
|
|
name: 'css',
|
|
|
|
path: `${__dirname}/static/css`
|
2018-11-09 22:20:44 +03:00
|
|
|
}
|
|
|
|
},
|
2017-08-20 14:43:49 +03:00
|
|
|
{
|
|
|
|
resolve: 'gatsby-plugin-feed',
|
|
|
|
options: {
|
|
|
|
query: `
|
|
|
|
{
|
|
|
|
site {
|
|
|
|
siteMetadata {
|
2018-02-11 16:14:51 -07:00
|
|
|
site_url: url
|
2017-08-20 14:43:49 +03:00
|
|
|
title
|
2018-02-11 16:14:51 -07:00
|
|
|
description: subtitle
|
2017-08-20 14:43:49 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`,
|
2018-11-09 20:08:48 +03:00
|
|
|
feeds: [{
|
|
|
|
serialize: ({ query: { site, allMarkdownRemark } }) => (
|
2019-11-07 13:37:20 +03:00
|
|
|
allMarkdownRemark.edges.map((edge) => ({
|
|
|
|
...edge.node.frontmatter,
|
2019-01-21 17:18:15 +03:00
|
|
|
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 20:08:48 +03:00
|
|
|
),
|
|
|
|
query: `
|
2017-08-20 14:43:49 +03:00
|
|
|
{
|
|
|
|
allMarkdownRemark(
|
|
|
|
limit: 1000,
|
|
|
|
sort: { order: DESC, fields: [frontmatter___date] },
|
2018-11-11 19:43:29 +03:00
|
|
|
filter: { frontmatter: { template: { eq: "post" }, draft: { ne: true } } }
|
2017-08-20 14:43:49 +03:00
|
|
|
) {
|
|
|
|
edges {
|
|
|
|
node {
|
|
|
|
html
|
|
|
|
fields {
|
|
|
|
slug
|
|
|
|
}
|
|
|
|
frontmatter {
|
|
|
|
title
|
|
|
|
date
|
2018-11-11 19:43:29 +03:00
|
|
|
template
|
2017-08-20 14:43:49 +03:00
|
|
|
draft
|
|
|
|
description
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`,
|
2019-08-24 15:32:06 +02:00
|
|
|
output: '/rss.xml',
|
|
|
|
title: siteConfig.title
|
2018-11-09 20:08:48 +03:00
|
|
|
}]
|
2017-08-20 14:43:49 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
resolve: 'gatsby-transformer-remark',
|
|
|
|
options: {
|
|
|
|
plugins: [
|
2019-07-16 14:58:11 +03:00
|
|
|
'gatsby-remark-relative-images',
|
2019-02-15 01:41:24 +03:00
|
|
|
{
|
|
|
|
resolve: 'gatsby-remark-katex',
|
|
|
|
options: {
|
|
|
|
strict: 'ignore'
|
|
|
|
}
|
|
|
|
},
|
2017-08-20 14:43:49 +03:00
|
|
|
{
|
|
|
|
resolve: 'gatsby-remark-images',
|
2019-07-16 14:58:11 +03:00
|
|
|
options: {
|
|
|
|
maxWidth: 960,
|
2020-11-14 01:58:54 +03:00
|
|
|
withWebp: true
|
2019-07-16 14:58:11 +03:00
|
|
|
}
|
2017-08-20 14:43:49 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
resolve: 'gatsby-remark-responsive-iframe',
|
2018-01-21 03:03:59 +03:00
|
|
|
options: { wrapperStyle: 'margin-bottom: 1.0725rem' }
|
2017-08-20 14:43:49 +03:00
|
|
|
},
|
2019-02-15 16:56:55 -05:00
|
|
|
'gatsby-remark-autolink-headers',
|
2017-08-20 14:43:49 +03:00
|
|
|
'gatsby-remark-prismjs',
|
|
|
|
'gatsby-remark-copy-linked-files',
|
2019-07-11 17:47:27 -04:00
|
|
|
'gatsby-remark-smartypants',
|
|
|
|
'gatsby-remark-external-links'
|
2017-08-20 14:43:49 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
'gatsby-transformer-sharp',
|
|
|
|
'gatsby-plugin-sharp',
|
2018-11-09 20:08:48 +03:00
|
|
|
'gatsby-plugin-netlify',
|
2017-08-20 14:43:49 +03:00
|
|
|
{
|
2018-11-09 20:08:48 +03:00
|
|
|
resolve: 'gatsby-plugin-netlify-cms',
|
2018-01-21 18:54:33 +03:00
|
|
|
options: {
|
2020-11-14 01:58:54 +03:00
|
|
|
modulePath: `${__dirname}/src/cms/index.js`
|
2018-01-21 18:54:33 +03:00
|
|
|
}
|
|
|
|
},
|
2018-11-09 20:08:48 +03:00
|
|
|
{
|
2019-03-21 16:53:15 -04:00
|
|
|
resolve: 'gatsby-plugin-google-gtag',
|
2019-03-19 16:26:49 -04:00
|
|
|
options: {
|
2019-03-21 16:53:15 -04:00
|
|
|
trackingIds: [siteConfig.googleAnalyticsId],
|
|
|
|
pluginConfig: {
|
2020-11-14 01:58:54 +03:00
|
|
|
head: true
|
|
|
|
}
|
|
|
|
}
|
2018-11-09 20:08:48 +03:00
|
|
|
},
|
2017-08-20 14:43:49 +03:00
|
|
|
{
|
|
|
|
resolve: 'gatsby-plugin-sitemap',
|
|
|
|
options: {
|
|
|
|
query: `
|
2018-11-09 20:08:48 +03:00
|
|
|
{
|
|
|
|
site {
|
|
|
|
siteMetadata {
|
2019-05-10 03:52:30 +03:00
|
|
|
siteUrl: url
|
2017-08-20 14:43:49 +03:00
|
|
|
}
|
2018-11-09 20:08:48 +03:00
|
|
|
}
|
|
|
|
allSitePage(
|
|
|
|
filter: {
|
|
|
|
path: { regex: "/^(?!/404/|/404.html|/dev-404-page/)/" }
|
|
|
|
}
|
|
|
|
) {
|
|
|
|
edges {
|
|
|
|
node {
|
|
|
|
path
|
2017-08-20 14:43:49 +03:00
|
|
|
}
|
|
|
|
}
|
2018-11-09 20:08:48 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
`,
|
2017-08-20 14:43:49 +03:00
|
|
|
output: '/sitemap.xml',
|
2019-01-21 17:18:15 +03:00
|
|
|
serialize: ({ site, allSitePage }) => allSitePage.edges.map((edge) => ({
|
2019-05-10 03:52:30 +03:00
|
|
|
url: site.siteMetadata.siteUrl + edge.node.path,
|
2019-01-21 17:18:15 +03:00
|
|
|
changefreq: 'daily',
|
|
|
|
priority: 0.7
|
|
|
|
}))
|
2017-08-20 14:43:49 +03:00
|
|
|
}
|
|
|
|
},
|
2019-01-22 01:11:07 +03: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'
|
|
|
|
},
|
|
|
|
},
|
2020-12-03 01:27:43 +07:00
|
|
|
{
|
|
|
|
resolve: 'gatsby-plugin-offline',
|
|
|
|
options: {
|
|
|
|
workboxConfig: {
|
|
|
|
runtimeCaching: [{
|
2020-12-03 01:38:24 +07:00
|
|
|
// Use cacheFirst since these don't need to be revalidated (same RegExp
|
|
|
|
// and same reason as above)
|
|
|
|
urlPattern: /(\.js$|\.css$|[^:]static\/)/,
|
|
|
|
handler: 'CacheFirst',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
// page-data.json files, static query results and app-data.json
|
|
|
|
// are not content hashed
|
|
|
|
urlPattern: /^https?:.*\/page-data\/.*\.json/,
|
|
|
|
handler: 'StaleWhileRevalidate',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
// Add runtime caching of various other page resources
|
|
|
|
urlPattern: /^https?:.*\.(png|jpg|jpeg|webp|svg|gif|tiff|js|woff|woff2|json|css)$/,
|
|
|
|
handler: 'StaleWhileRevalidate',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
// Google Fonts CSS (doesn't end in .css so we need to specify it)
|
|
|
|
urlPattern: /^https?:\/\/fonts\.googleapis\.com\/css/,
|
|
|
|
handler: 'StaleWhileRevalidate',
|
|
|
|
},
|
2020-12-03 01:27:43 +07:00
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2017-08-20 14:43:49 +03:00
|
|
|
'gatsby-plugin-catch-links',
|
|
|
|
'gatsby-plugin-react-helmet',
|
2018-11-09 20:08:48 +03:00
|
|
|
{
|
|
|
|
resolve: 'gatsby-plugin-sass',
|
|
|
|
options: {
|
|
|
|
postCssPlugins: [...postCssPlugins],
|
|
|
|
cssLoaderOptions: {
|
2020-11-14 01:58:54 +03:00
|
|
|
camelCase: false
|
2018-11-09 20:08:48 +03:00
|
|
|
}
|
|
|
|
}
|
2019-04-08 11:53:56 -04:00
|
|
|
},
|
2020-11-14 01:58:54 +03:00
|
|
|
{
|
|
|
|
resolve: '@sentry/gatsby',
|
|
|
|
options: {
|
|
|
|
dsn: process.env.SENTRY_DSN,
|
|
|
|
tracesSampleRate: 1
|
|
|
|
}
|
|
|
|
},
|
2019-08-02 15:02:55 -04:00
|
|
|
'gatsby-plugin-flow',
|
2020-11-14 01:58:54 +03:00
|
|
|
'gatsby-plugin-optimize-svgs'
|
2017-08-20 14:43:49 +03:00
|
|
|
]
|
|
|
|
};
|