const config = require("./content/config.json"); module.exports = { pathPrefix: config.pathPrefix, siteMetadata: { url: config.url, title: config.title, subtitle: config.subtitle, copyright: config.copyright, disqusShortname: config.disqusShortname, postsPerPage: config.postsPerPage, menu: config.menu, author: config.author, }, plugins: [ { resolve: "gatsby-source-filesystem", options: { path: `${__dirname}/content`, name: "content", }, }, { resolve: "gatsby-plugin-feed", options: { query: ` { site { siteMetadata { url title subtitle } } } `, feeds: [ { serialize: ({ query: { site, allMarkdownRemark } }) => allMarkdownRemark.edges.map(edge => ({ ...edge.node.frontmatter, description: edge.node.frontmatter.description, date: edge.node.frontmatter.date, url: site.siteMetadata.url + edge.node.fields.slug, guid: site.siteMetadata.url + edge.node.fields.slug, custom_elements: [{ "content:encoded": edge.node.html }], })), query: ` { allMarkdownRemark( limit: 1000, sort: { order: DESC, fields: [frontmatter___date] }, filter: { frontmatter: { template: { eq: "post" }, draft: { ne: true } } } ) { edges { node { html fields { slug } frontmatter { title date template draft description } } } } } `, output: "/rss.xml", title: config.title, }, ], }, }, { resolve: "gatsby-transformer-remark", options: { plugins: [ { resolve: "gatsby-remark-images", options: { maxWidth: 960, withWebp: true, }, }, { resolve: "gatsby-remark-responsive-iframe", options: { wrapperStyle: "margin-bottom: 1.0725rem" }, }, "gatsby-remark-autolink-headers", "gatsby-remark-prismjs", "gatsby-remark-copy-linked-files", "gatsby-remark-smartypants", "gatsby-remark-external-links", ], }, }, "gatsby-transformer-sharp", "gatsby-plugin-sharp", { resolve: "gatsby-plugin-google-gtag", options: { trackingIds: [config.googleAnalyticsId], pluginConfig: { head: true, }, }, }, { resolve: "gatsby-plugin-sitemap", options: { query: ` { site { siteMetadata { siteUrl: url } } allSitePage( filter: { path: { regex: "/^(?!/404/|/404.html|/dev-404-page/)/" } } ) { edges { node { path } } } } `, output: "/sitemap.xml", serialize: ({ site, allSitePage }) => allSitePage.edges.map(edge => ({ url: site.siteMetadata.siteUrl + edge.node.path, changefreq: "daily", priority: 0.7, })), }, }, { resolve: "gatsby-plugin-manifest", options: { name: config.title, short_name: config.title, start_url: "/", background_color: "#FFF", theme_color: "#F7A046", display: "standalone", icon: "content/photo.jpg", }, }, { resolve: "gatsby-plugin-offline", options: { workboxConfig: { runtimeCaching: [ { urlPattern: /(\.js$|\.css$|[^:]static\/)/, handler: "CacheFirst", }, { urlPattern: /^https?:.*\/page-data\/.*\.json/, handler: "StaleWhileRevalidate", }, { urlPattern: /^https?:.*\.(png|jpg|jpeg|webp|svg|gif|tiff|js|woff|woff2|json|css)$/, handler: "StaleWhileRevalidate", }, { urlPattern: /^https?:\/\/fonts\.googleapis\.com\/css/, handler: "StaleWhileRevalidate", }, ], }, }, }, "gatsby-plugin-catch-links", "gatsby-plugin-react-helmet", { resolve: "gatsby-plugin-sass", options: { implementation: require("sass"), cssLoaderOptions: { camelCase: false, }, }, }, { resolve: "@sentry/gatsby", options: { dsn: process.env.SENTRY_DSN, tracesSampleRate: 1, }, }, "gatsby-plugin-optimize-svgs", ], };