import type { GatsbyConfig } from "gatsby";

import siteConfig from './data/site-config';

const config: GatsbyConfig = {
  siteMetadata: {
    title: siteConfig.siteTitle,
    siteUrl: `https://derivative.my.id`,
    description: siteConfig.siteDescription,
    author: siteConfig.siteTitle
  },
  // More easily incorporate content into your pages through automatic TypeScript type generation and better GraphQL IntelliSense.
  // If you use VSCode you can also use the GraphQL plugin
  // Learn more at: https://gatsby.dev/graphql-typegen
  graphqlTypegen: true,
  plugins: [
    "gatsby-plugin-sass",
    `gatsby-plugin-image`,
    "gatsby-remark-images",
    `gatsby-plugin-sharp`,
    "gatsby-transformer-sharp",
    {
      resolve: "gatsby-transformer-remark",
      options: {
          plugins: ["gatsby-remark-gifs"],
      },
    },
    {
      resolve: `gatsby-plugin-mdx`,
      options: {
        extensions: [`.md`, `.mdx`],
        commonmark: true,
        footnotes: true,
        pedantic: true,
        gfm: true,
        gatsbyRemarkPlugins: [
          {
            resolve: `gatsby-remark-images`,
            options: {
              maxWidth: 400,
            },
          },
          {
            resolve: `gatsby-remark-prismjs`,
            options: {
              classPrefix: "language-",
              inlineCodeMarker: null,
              aliases: {
                sh  :"bash",
                js  :"javascript",
                ts  :"typescript",
                rs  :"rust",
                hs  : "haskell",
                exs :"elixir",
              },
            },
          },
        ],
      },
    },
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        name: `images`,
        path: `${__dirname}/src/assets/images`,
      },
    },
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        name: `gif`,
        path: `${__dirname}/src/assets/gif`,
      },
    },
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        name: `markdown-pages`,
        path: `${__dirname}/contents`,
      },
    },
    {
      resolve: `gatsby-plugin-manifest`,
      options: {
        name: siteConfig.siteTitle,
        short_name: siteConfig.siteTitle,
        description: siteConfig.siteDescription,
        start_url: siteConfig.pathPrefix,
        background_color: `#4ecca3`,
        theme_color: `#4ecca3`,
        display: `minimal-ui`,
        icon: siteConfig.icon,
      },
    },
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        name: `assets`,
        path: `${__dirname}/src/assets/`,
      },
    },
    {
    resolve: 'gatsby-source-filesystem',
    options: {
      "name": "pages",
      "path": "./src/pages/"
    },
    __key: "pages"
  }]
};

export default config;
