require("dotenv").config() const siteConfig = require("./config") const { NODE_ENV, URL: NETLIFY_SITE_URL = "https://devthread.ru/", DEPLOY_PRIME_URL: NETLIFY_DEPLOY_URL = NETLIFY_SITE_URL, CONTEXT: NETLIFY_ENV = NODE_ENV, } = process.env module.exports = { siteMetadata: { ...siteConfig, }, plugins: [ "gatsby-plugin-react-helmet", "gatsby-plugin-preact", "gatsby-plugin-sass", { resolve: "gatsby-source-filesystem", options: { path: `${__dirname}/static/assets`, name: "assets", }, }, { resolve: "gatsby-source-filesystem", options: { name: "content", path: `${__dirname}/content`, }, }, { resolve: "gatsby-plugin-react-svg", options: { rule: { include: /images/, }, }, }, { resolve: `gatsby-plugin-yandex-metrika`, options: { // The ID of yandex metrika. trackingId: 67663189, // Enabled a webvisor. The default value is `false`. webvisor: true, // Enables tracking a hash in URL. The default value is `false`. trackHash: true, // Defines where to place the tracking script - `false` means before body (slower loading, more hits) // and `true` means after the body (faster loading, less hits). The default value is `false`. afterBody: true, // Use `defer` attribute of metrika script. If set to `false` - script will be loaded with `async` attribute. // Async enables earlier loading of the metrika but it can negatively affect page loading speed. The default value is `false`. defer: false, }, }, "gatsby-plugin-sitemap", { resolve: "gatsby-plugin-robots-txt", options: { resolveEnv: () => NETLIFY_ENV, env: { production: { policy: [{ userAgent: "*" }], }, "branch-deploy": { policy: [{ userAgent: "*", disallow: ["/"] }], sitemap: null, host: null, }, "deploy-preview": { policy: [{ userAgent: "*", disallow: ["/"] }], sitemap: null, host: null, }, }, }, }, { resolve: `gatsby-plugin-manifest`, options: { name: `devthread`, short_name: `devthread`, start_url: `/`, background_color: `#ffffff`, icons: [ { src: `/android-chrome-192x192.png`, sizes: `192x192`, type: `image/png`, }, { src: `/android-chrome-512x512.png`, sizes: `512x512`, type: `image/png`, }, ], theme_color: `#ffffff`, display: `standalone`, }, }, { 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 Object.assign({}, edge.node.frontmatter, { categories: edge.node.frontmatter.tags, description: edge.node.frontmatter.description, date: edge.node.frontmatter.date, url: `${site.siteMetadata.siteUrl}/article/${edge.node.frontmatter.slug}`, guid: `${site.siteMetadata.siteUrl}/article/${edge.node.frontmatter.slug}`, custom_elements: [{ "content:encoded": edge.node.html }], }) }) }, query: ` { allMarkdownRemark( filter: { frontmatter: { templateKey: { eq: "article" } } } sort: { order: DESC, fields: frontmatter___date } ) { edges { node { html frontmatter { slug title description category tags date } } } } } `, output: "/rss.xml", title: "devthread.ru | RSS Лента", }, ], }, }, { resolve: `gatsby-plugin-amp`, options: { canonicalBaseUrl: "https://devthread.ru/", components: ["amp-sidebar", "amp-accordion", "amp-form"], excludedPaths: ["/404*", "/"], pathIdentifier: "/amp/", relAmpHtmlPattern: "{{canonicalBaseUrl}}{{pathIdentifier}}{{pathname}}", relCanonicalPattern: "{{canonicalBaseUrl}}{{pathname}}/", useAmpClientIdApi: false, }, }, { resolve: "gatsby-plugin-firebase", options: { credentials: { apiKey: process.env.API_KEY, authDomain: process.env.AUTH_DOMAIN, databaseURL: process.env.DATABASE_URL, projectId: process.env.PROJECT_ID, storageBucket: process.env.STORAGE_BUCKET, messagingSenderId: process.env.MESSAGING_SENDER_ID, appId: process.env.APP_ID, }, }, }, { resolve: `gatsby-plugin-nprogress`, options: { color: `#5183F5`, showSpinner: false, }, }, "gatsby-transformer-sharp", "gatsby-plugin-sharp", { resolve: `gatsby-transformer-remark`, options: { plugins: [ { resolve: `gatsby-plugin-netlify-cms-paths`, options: { cmsConfig: `/static/admin/config.yml`, }, }, { resolve: `gatsby-remark-images`, options: { maxWidth: 900, quality: 100, withWebp: true, loading: "lazy", linkImagesToOriginal: true, }, }, `gatsby-remark-responsive-iframe`, { resolve: "gatsby-remark-copy-linked-files", options: { destinationDir: "static", }, }, { resolve: `gatsby-remark-autolink-headers`, options: { offsetY: `140`, icon: ``, className: `anchor-link`, maintainCase: true, removeAccents: true, isIconAfterHeader: true, elements: [`h1`, `h2`, `h3`, `h4`], }, }, { resolve: `gatsby-remark-prismjs`, options: { classPrefix: "language-", inlineCodeMarker: null, aliases: {}, showLineNumbers: true, noInlineHighlight: false, languageExtensions: [ { language: "superscript", extend: "javascript", definition: { superscript_types: /(SuperType)/, }, insertBefore: { function: { superscript_keywords: /(superif|superelse)/, }, }, }, ], prompt: { user: "root", host: "localhost", global: false, }, escapeEntities: {}, }, }, ], }, }, "gatsby-plugin-netlify-cms", ], }