text: require('dotenv').config({
    path: `.env`
  })
  
  const linkResolver = require('./src/utils/linkResolver')
  
  module.exports = {
    siteMetadata: {
      title: 'Blog',
      titleTemplate: '%s',
      description: `example`,
      author: ``,
      siteUrl: `http://localhost:8000/`
    },
    plugins: [
      {
        resolve: `gatsby-plugin-google-analytics`,
        options: {
          // add your own GA_ID in the env file
          trackingId: `${process.env.GA_ID}`
        }
      },
      `gatsby-plugin-react-helmet`,
      `gatsby-plugin-sitemap`,
      {
        resolve: `gatsby-source-filesystem`,
        options: {
          name: `images`,
          path: `${__dirname}/src/images`
        }
      },
      `gatsby-transformer-sharp`,
      `gatsby-plugin-sharp`,
      `gatsby-plugin-styled-components`,
      {
        resolve: `gatsby-plugin-google-fonts`,
        options: {
          fonts: [
            `cambay\:400,700`,
            `arvo\:400,700`,
            `ubuntu mono\:400,700`,
          ],
          display: 'swap',
        },
      },
      {
        resolve: `gatsby-plugin-manifest`,
        options: {
          name: `Gatsby Prismic Blog Starter`,
          short_name: `Blog`,
          description: `A blog starter template developed using Gatsby and Prismic. This starter is styled using Theme UI which allows for more easy customization.`,
          start_url: `/`,
          background_color: `#f7f8f9`,
          theme_color: `#181818`,
          display: `standalone`,
          icon: `src/images/gatsby-icon.png`
        }
      },
      {
        resolve: 'gatsby-source-prismic',
        options: {
          repositoryName: `${process.env.GATSBY_PRISMIC_REPOSITORY_NAME}`,
          accessToken: `${process.env.PRISMIC_ACCESS_TOKEN}`,
        
          linkResolver: () => (doc) => linkResolver(doc),
  
          schemas: {
            article: require('./src/schemas/article.json'),
            category: require('./src/schemas/category.json'),
            author: require('./src/schemas/author.json')
          },
          shouldDownloadImage: ({ node, key, value }) => {
            // Return true to download the image or false to skip.
            return false
          },
        }
      },
      `gatsby-plugin-offline`
    ]
  }
  