text: require('dotenv').config();
  const queries = require('./src/utils/algolia_queries');
  
  module.exports = {
    siteMetadata: {
      title: `Junior Alves`,
      position: `Javascript Developer`,
      description: `Escrevo sobre código e livros.`,
      author: `jjunior`,
      siteUrl: `https://devjuniorplus.com.br`,
    },
    plugins: [
      `gatsby-plugin-transition-link`,
      `gatsby-plugin-react-helmet`,
      `gatsby-plugin-styled-components`,
      // Precisa ser a primeira config do file-system
      {
        resolve: `gatsby-source-filesystem`,
        options: {
          name: `uploads`,
          path: `${__dirname}/static/assets/images`,
        },
      },
      {
        resolve: `gatsby-source-filesystem`,
        options: {
          name: `images`,
          path: `${__dirname}/src/images`,
        },
      },
      {
        resolve: `gatsby-source-filesystem`,
        options: {
          name: `posts`,
          path: `${__dirname}/posts`,
        },
      },
      {
        resolve: `gatsby-transformer-remark`,
        options: {
          plugins: [
            {
              resolve: 'gatsby-remark-relative-images-v2',
              options: {
                name: 'uploads',
              },
            },
            {
              resolve: 'gatsby-remark-images',
              options: {
                maxWidth: 960,
                quality: 90,
                disableBgImageOnAlpha: true,
                linkImagesToOriginal: false,
              },
            },
            `gatsby-remark-lazy-load`,
            `gatsby-remark-prismjs`,
          ],
        },
      },
      `gatsby-transformer-sharp`,
      `gatsby-plugin-sharp`,
      {
        resolve: `gatsby-plugin-algolia-search`,
        options: {
          appId: process.env.GATSBY_ALGOLIA_APP_ID,
          apiKey: process.env.ALGOLIA_ADMIN_KEY,
          indexName: process.env.GATSBY_ALGOLIA_INDEX_NAME,
          queries,
          chunkSize: 10000,
          enablePartialUpdates: true,
        },
      },
      {
        resolve: `gatsby-plugin-manifest`,
        options: {
          name: `Junior Alves`,
          short_name: `JR`,
          start_url: `/`,
          background_color: `#383A47`,
          theme_color: `#383A47`,
          display: `standalone`,
          lang: 'pt-BR',
          icon: `src/images/icon.png`, // This path is relative to the root of the site.
        },
      },
  
      {
        resolve: `gatsby-plugin-google-analytics`,
        options: {
          trackingId: process.env.TRACKING_ID,
          head: true,
          anonymize: true,
        },
      },
  
      // XML, para rodar, gatsby build && gatsby-server
      `gatsby-plugin-sitemap`,
      // this (optional) plugin enables Progressive Web App + Offline functionality
      // To learn more, visit: https://gatsby.dev/offline
      `gatsby-plugin-offline`,
      `gatsby-plugin-netlify-cms`,
      {
        resolve: `gatsby-plugin-feed`,
        options: {
          query: `
            {
              site {
                siteMetadata {
                  title
                  description
                  siteUrl
                  site_url: siteUrl
                }
              }
            }
          `,
          feeds: [
            {
              serialize: ({ query: { site, allMarkdownRemark } }) => {
                return allMarkdownRemark.edges.map(edge => {
                  return {
                    ...edge.node.frontmatter,
                    description: edge.node.frontmatter.description,
                    date: edge.node.frontmatter.date,
                    url: site.siteMetadata.siteUrl + edge.node.fields.slug,
                    guid: site.siteMetadata.siteUrl + edge.node.fields.slug,
                    custom_elements: [{ 'content:encoded': edge.node.html }],
                  };
                });
              },
              query: `
                {
                  allMarkdownRemark(sort: {order: DESC, fields: [frontmatter___date]}) {
                    edges {
                      node {
                        fields {
                          slug
                        }
                        frontmatter {
                          title
                          description
                          date
                        }
                        excerpt
                      }
                    }
                  }
                }
              `,
              output: '/feed.xml',
              title: 'Dev Junior Plus Blog - RSS Feed',
            },
          ],
        },
      },
    ],
  };
  