Skip to content

Exclude pages from the build

Philipp Hartenfeller edited this page Aug 22, 2021 · 3 revisions

If you have private pages you don't want to include in you builds you can specify an ignore array in your gatsby-config.js:

plugins: [
    {
      resolve: `gatsby-philipps-foam-theme`,
      options: {
        rootNote: "/readme",
        contentPath: `${__dirname}/..`,
        ignore: [
          "**/_layouts/**",
          "**/private/**/*",
        ],
      },
    },
  ],

All markdown files in the private folder will be ignored an no HTML page generated for them.

All links to excluded page wil be replaced with following text: excluded page. (issue #6)

Clone this wiki locally