text: var proxy = require('http-proxy-middleware')
  
  module.exports = {
    siteMetadata: {
      title: 'Lonestar Adventure Cast',
      description:
        'This repo contains an example business website that is built with Gatsby, and Netlify CMS.It follows the JAMstack architecture by using Git as a single source of truth, and Netlify for continuous deployment, and CDN distribution.'
    },
    mapping: {
      'MarkdownRemark.fields.author': 'MarkdownRemark',
      'MarkdownRemark.fields.posts': 'MarkdownRemark'
    },
    plugins: [
      'gatsby-plugin-react-helmet',
      'gatsby-plugin-sass',
      {
        // keep as first gatsby-source-filesystem plugin for gatsby image support
        resolve: 'gatsby-source-filesystem',
        options: {
          path: `${__dirname}/static/img`,
          name: 'uploads'
        }
      },
      {
        resolve: 'gatsby-source-filesystem',
        options: {
          path: `${__dirname}/src/pages`,
          name: 'pages'
        }
      },
      {
        resolve: 'gatsby-source-filesystem',
        options: {
          path: `${__dirname}/src/img`,
          name: 'images'
        }
      },
      {
        resolve: 'gatsby-plugin-web-font-loader',
        options: {
          google: {
            families: ['Archivo:400,700']
          }
        }
      },
      'gatsby-plugin-sharp',
      'gatsby-transformer-sharp',
      {
        resolve: 'gatsby-transformer-remark',
        options: {
          plugins: [
            {
              resolve: `gatsby-remark-external-links`,
              options: {
                target: `_blank`,
                rel: `nofollow noopener noreferrer`
              }
            },
            {
              resolve: 'gatsby-remark-embed-video',
              options: {
                width: 800,
                ratio: 1.77,
                height: 400,
                related: false,
                noIframeBorder: true
              }
            },
            'gatsby-remark-responsive-iframe',
            {
              resolve: 'gatsby-remark-embed-soundcloud',
              options: {
                width: '100%',
                height: '100%',
                color: 'FF4400',
                autoplay: false
              }
            },
            {
              resolve: 'gatsby-remark-relative-images',
              options: {
                name: 'uploads'
              }
            },
            {
              resolve: 'gatsby-remark-images',
              options: {
                // It's important to specify the maxWidth (in pixels) of
                // the content container as this plugin uses this as the
                // base for generating different widths of each image.
                maxWidth: 2048
              }
            },
            {
              resolve: 'gatsby-remark-copy-linked-files',
              options: {
                destinationDir: 'static'
              }
            }
          ]
        }
      },
      {
        resolve: 'gatsby-plugin-nprogress',
        options: {
          color: '#D64000',
          showSpinner: false
        }
      },
      {
        resolve: 'gatsby-plugin-netlify-cms',
        options: {
          modulePath: `${__dirname}/src/cms/cms.js`
        }
      },
      {
        resolve: 'gatsby-plugin-purgecss', // purges all unused/unreferenced css rules
        options: {
          develop: true, // Activates purging in npm run develop
          purgeOnly: ['/all.sass'] // applies purging only on the bulma css file
        }
      }, // must be after other CSS plugins
      'gatsby-plugin-netlify' // make sure to keep it last in the array
    ],
    // for avoiding CORS while developing Netlify Functions locally
    // read more: https://www.gatsbyjs.org/docs/api-proxy/#advanced-proxying
    developMiddleware: app => {
      app.use(
        '/.netlify/functions/',
        proxy({
          target: 'http://localhost:9000',
          pathRewrite: {
            '/.netlify/functions/': ''
          }
        })
      )
    }
  }
  