const lost = require('lost')
const pxtorem = require('postcss-pxtorem')

module.exports = {
  siteMetadata: {
    url: 'https://www.nicoespeon.com',
    title: "@nicoespeon's blog",
    subtitles: {
      en: 'I write about VS Code, web development and life in general.',
      fr:
        'J’écris à propos de VS Code, du développement web et de la vie en général.',
    },
    greetings: {
      en: "Hi, I'm Nicolas 👋",
      fr: 'Salut, je suis Nicolas 👋',
    },
    menus: {
      en: [
        {
          label: 'Articles',
          path: '/',
        },
        {
          label: 'Talks',
          path: '/talks',
        },
        {
          label: 'Side projects',
          path: '/projects',
        },
        {
          label: 'Who I am',
          path: '/about',
        },
        {
          label: 'My recommendations',
          path: '/worth-reading',
        },
        {
          label: 'TIL (Today I learned)',
          path: '/tags/til',
        },
      ],
      fr: [
        {
          label: 'Articles',
          path: '/fr/',
        },
        {
          label: 'Talks',
          path: '/fr/talks',
        },
        {
          label: 'Projets personnels',
          path: '/fr/projects',
        },
        {
          label: 'Qui je suis',
          path: '/fr/about',
        },
        {
          label: 'Mes recommandations',
          path: '/fr/worth-reading',
        },
      ],
    },
    author: {
      name: 'Nicolas Carlo',
      email: 'nicolascarlo.espeon@gmail.com',
      twitter: 'nicoespeon',
      github: 'nicoespeon',
      linkedin: 'nicolas-carlo-095b243b',
      rss: '/feed.xml',
    },
    feedDescription:
      'I write about web development, agile practices and personal organization.',
  },
  plugins: [
    {
      resolve: 'gatsby-source-filesystem',
      options: {
        path: `${__dirname}/src/pages`,
        name: 'pages',
      },
    },
    {
      resolve: 'gatsby-plugin-feed',
      options: {
        query: `
          {
            site {
              siteMetadata {
                site_url: url
                title
                description: feedDescription
              }
            }
          }
        `,
        feeds: [
          {
            serialize: ({ query: { site, allMarkdownRemark } }) =>
              allMarkdownRemark.edges.map(edge =>
                Object.assign({}, edge.node.frontmatter, {
                  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 }],
                })
              ),
            query: `
              {
                allMarkdownRemark(
                  limit: 1000,
                  sort: { order: DESC, fields: [frontmatter___date] },
                  filter: { frontmatter: { layout: { eq: "post" }, draft: { ne: true } } }
                ) {
                  edges {
                    node {
                      html
                      fields {
                        slug
                      }
                      frontmatter {
                        title
                        date
                        layout
                        draft
                        description
                      }
                    }
                  }
                }
              }
            `,
            output: '/feed.xml',
          },
        ],
      },
    },
    {
      resolve: 'gatsby-transformer-remark',
      options: {
        plugins: [
          {
            resolve: 'gatsby-remark-images',
            options: {
              maxWidth: 960,
            },
          },
          {
            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-transformer-sharp',
    'gatsby-plugin-sharp',
    {
      resolve: 'gatsby-plugin-google-analytics',
      options: { trackingId: 'UA-39957541-2' },
    },
    {
      resolve: 'gatsby-plugin-google-fonts',
      options: {
        fonts: ['roboto:400,400i,500,700'],
      },
    },
    {
      resolve: 'gatsby-plugin-sitemap',
      options: {
        query: `
            {
              site {
                siteMetadata {
                  url
                }
              }
              allSitePage(
                filter: {
                  path: { regex: "/^(?!/404/|/404.html|/dev-404-page/)/" }
                }
              ) {
                edges {
                  node {
                    path
                  }
                }
              }
          }`,
        output: '/sitemap.xml',
        serialize: ({ site, allSitePage }) =>
          allSitePage.edges.map(edge => {
            return {
              url: site.siteMetadata.url + edge.node.path,
              changefreq: 'daily',
              priority: 0.7,
            }
          }),
      },
    },
    'gatsby-plugin-offline',
    'gatsby-plugin-catch-links',
    'gatsby-plugin-react-helmet',
    {
      resolve: 'gatsby-plugin-sass',
      options: {
        postCssPlugins: [
          lost(),
          pxtorem({
            rootValue: 16,
            unitPrecision: 5,
            propList: [
              'font',
              'font-size',
              'line-height',
              'letter-spacing',
              'margin',
              'margin-top',
              'margin-left',
              'margin-bottom',
              'margin-right',
              'padding',
              'padding-top',
              'padding-left',
              'padding-bottom',
              'padding-right',
              'border-radius',
              'width',
              'max-width',
            ],
            selectorBlackList: [],
            replace: true,
            mediaQuery: false,
            minPixelValue: 0,
          }),
        ],
        precision: 8,
      },
    },
    'gatsby-plugin-favicon',
  ],
}

@@ -888,100 +888,8 @@
  %7D,%0A
-        %7B%0A          label: 'TIL (Today I learned)',%0A          path: '/tags/til',%0A        %7D,%0A
     

Drop TIL link