Skip to content
Snippets Groups Projects
Select Git revision
  • 09a2c2e8e2331832800e036c5b98ee34f1c170ac
  • main default protected
  • renovate/quay.io-shivering-isles-postfix-3.x
  • renovate/github.com-prometheus-common-0.x
  • renovate/redis-21.x
  • renovate/docker.io-library-nextcloud-31.x
  • renovate/hcloud-exporter-4.x
  • renovate/rancher-system-upgrade-controller-0.x
  • renovate/ghcr.io-mastodon-mastodon-4.x
  • renovate/docker.io-bitnami-kubectl-1.x
  • renovate/mikefarah-yq-4.x
  • renovate/mariadb-21.x
  • renovate/go-1.x
  • renovate/prometheus-json-exporter-0.x
  • renovate/amd-gpu-0.x
  • renovate/siderolabs-kubelet-1.33.x
  • renovate/kubernetes-go
  • renovate/external-snapshotter-8.x
  • renovate/gcr.io-projectsigstore-cosign-2.x
  • renovate/kubernetes-sigs-cluster-api-1.x
  • renovate/cloudflare-5.x
  • v25.07
  • v25.06
  • v25.05
  • v25.04
  • v25.03
  • v25.02
  • v25.01
  • v24.12
  • v24.11
  • v24.10
  • v24.09
  • v24.08
  • v24.07
  • v24.06
  • v24.05
  • v24.04
  • v24.03
  • v24.02
  • v24.01
  • v23.12
41 results

validate.sh

Blame
  • gatsby-node.js 1.33 KiB
    'use strict'
    
    /*
     * Implement Gatsby's Node APIs in this file.
     *
     * See: https://www.gatsbyjs.org/docs/node-apis/
     */
    
    const fs = require('fs')
    const yaml = require('js-yaml')
    const envFlag = require('node-env-flag')
    
    const includeDevPages = envFlag(process.env.INCLUDE_DEV_PAGES, true)
    
    const { categories } = yaml.safeLoad(
      fs.readFileSync('./service-definitions.yml', 'utf8')
    )
    
    // Often in Gatsby context gets piped through GraphQL, but GraphQL adds
    // unnecessary complexity here, so this uses the programmatic API.
    // https://www.gatsbyjs.org/docs/using-gatsby-without-graphql/#the-approach-fetch-data-and-use-gatsbys-createpages-api
    async function createPages({ actions: { createPage } }) {
      if (includeDevPages) {
        createPage({
          path: '/dev/styles',
          component: require.resolve(
            './frontend/components/development/style-page.tsx'
          ),
        })
        createPage({
          path: '/dev/logos',
          component: require.resolve(
            './frontend/components/development/logo-page.tsx'
          ),
        })
      }
    
      categories.forEach(category => {
        const { id } = category
        createPage({
          path: `/category/${id}`,
          component: require.resolve('./frontend/components/main.tsx'),
          // `context` provided here becomes `props.pageContext` on the page.
          context: { category },
        })
      })
    }
    
    module.exports = { createPages }