Detalhes do pacote

gatsby-plugin-page-creator

gatsbyjs1.2mMIT5.15.0

Gatsby plugin that automatically creates pages from React components in specified directories

gatsby, gatsby-plugin

readme (leia-me)

gatsby-plugin-page-creator

Gatsby plugin that automatically creates pages from React components in specified directories. Gatsby includes this plugin automatically in all sites for creating pages from components in src/pages. You can also leverage the File System Route API to programmatically create pages from your data.

You may include another instance of this plugin if you'd like to create additional "pages" directories or want to override the default usage.

With this plugin, any file that lives in the specified pages folder (e.g. the default src/pages) or subfolders will be expected to export a React Component to generate a Page. The following files are automatically excluded:

  • template-*
  • __tests__/*
  • *.test.jsx?
  • *.spec.jsx?
  • *.d.tsx?
  • *.json
  • *.yaml
  • _*
  • .*

To exclude custom patterns, see Ignoring Specific Files

Install

npm install gatsby-plugin-page-creator

How to use

Add the plugin to your gatsby-config.js:

// gatsby-config.js

module.exports = {
  plugins: [
    // You can have multiple instances of this plugin
    // to create pages from React components in different directories.
    //
    // The following sets up the pattern of having multiple
    // "pages" directories in your project
    {
      resolve: `gatsby-plugin-page-creator`,
      options: {
        path: `${__dirname}/src/account/pages`,
      },
    },
    {
      resolve: `gatsby-plugin-page-creator`,
      options: {
        path: `${__dirname}/src/settings/pages`,
      },
    },
    // You can also overwrite the default behavior for src/pages
    // This changes the page-creator instance used by Gatsby
    {
      resolve: `gatsby-plugin-page-creator`,
      options: {
        path: `${__dirname}/src/pages`,
        ignore: [`foo-bar.js`],
      },
    },
  ],
}

Options

The plugin supports options to ignore files and to pass options to the slugify instance that is used in the File System Route API to create slugs.

Option Type Description Required
path string Any file that lives inside this directory will be expected to export a React component to generate a page true
ignore IPathIgnoreOptions ∣ string ∣ Array<string> ∣ null Ignore certain files inside the directory specified with path false
slugify ISlugifyOptions Pass options to the slugify instance that is used inside the File System Route API to generate the slug false

Ignoring Specific Files

Shorthand

The following example will disable the /blog index page:

// gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: `gatsby-plugin-page-creator`,
      options: {
        path: `${__dirname}/src/indexes/pages`,
        ignore: [`blog.(js|ts)?(x)`],
        // See pattern syntax recognized by micromatch
        // https://www.npmjs.com/package/micromatch#matching-features
      },
    },
  ],
}

NOTE: The above code snippet will only stop the creation of the /blog page, which is defined as a React component. This plugin does not affect programmatically generated pages from the createPages API.

Ignore Options

The following example will ignore pages using case-insensitive matching:

// gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: `gatsby-plugin-page-creator`,
      options: {
        path: `${__dirname}/src/examples/pages`,
        ignore: {
          // Example: Ignore `file.example.js`, `dir/s/file.example.tsx`
          patterns: [`**/*.example.(js|ts)?(x)`],
          // Example: Match both `file.example.js` and `file.EXAMPLE.js`
          options: { nocase: true },
          // See all available micromatch options
          // https://www.npmjs.com/package/micromatch#optionsnocase
        },
      },
    },
  ],
}

changelog (log de mudanças)

Changelog: gatsby-plugin-page-creator

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

5.14.0 (2024-11-06)

🧾 Release notes

Bug Fixes

Chores

5.13.1 (2024-01-23)

Note: Version bump only for package gatsby-plugin-page-creator

5.13.0 (2023-12-18)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-page-creator

5.12.3 (2023-10-26)

Note: Version bump only for package gatsby-plugin-page-creator

5.12.2 (2023-10-20)

Note: Version bump only for package gatsby-plugin-page-creator

5.12.1 (2023-10-09)

Note: Version bump only for package gatsby-plugin-page-creator

5.12.0 (2023-08-24)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-page-creator

5.11.0 (2023-06-15)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-page-creator

5.10.0 (2023-05-16)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-page-creator

5.9.0 (2023-04-18)

🧾 Release notes

Bug Fixes

5.8.0 (2023-03-21)

🧾 Release notes

Bug Fixes

5.7.0 (2023-02-21)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-page-creator

5.6.0 (2023-02-07)

🧾 Release notes

Bug Fixes

5.5.0 (2023-01-24)

🧾 Release notes

Chores

5.4.0 (2023-01-10)

🧾 Release notes

Chores

5.3.1 (2022-12-14)

Note: Version bump only for package gatsby-plugin-page-creator

5.3.0 (2022-12-13)

🧾 Release notes

Bug Fixes

5.2.0 (2022-11-25)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-page-creator

5.1.0 (2022-11-22)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-page-creator

5.0.0 (2022-11-08)

🧾 Release notes

Bug Fixes

Chores

4.24.1 (2022-10-10)

Note: Version bump only for package gatsby-plugin-page-creator

4.24.0 (2022-09-27)

🧾 Release notes

Bug Fixes

4.23.1 (2022-09-22)

Note: Version bump only for package gatsby-plugin-page-creator

4.23.0 (2022-09-13)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-page-creator

4.22.0 (2022-08-30)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-page-creator

4.21.0 (2022-08-16)

🧾 Release notes

Other Changes

4.20.0 (2022-08-02)

🧾 Release notes

Bug Fixes

4.19.0 (2022-07-19)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-page-creator

4.18.1 (2022-07-12)

Note: Version bump only for package gatsby-plugin-page-creator

4.18.0 (2022-07-05)

🧾 Release notes

Bug Fixes

4.17.0 (2022-06-21)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-page-creator

4.16.0 (2022-06-07)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-page-creator

4.15.1 (2022-06-01)

Note: Version bump only for package gatsby-plugin-page-creator

4.15.0 (2022-05-24)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-page-creator

4.14.1 (2022-05-16)

Note: Version bump only for package gatsby-plugin-page-creator

4.14.0 (2022-05-10)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-page-creator

4.13.0 (2022-04-26)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-page-creator

4.12.1 (2022-04-13)

Note: Version bump only for package gatsby-plugin-page-creator

4.12.0 (2022-04-12)

🧾 Release notes

Bug Fixes

  • update dependency globby to ^11.1.0 for gatsby-plugin-page-creator #35282 (9a28752)

4.11.1 (2022-03-31)

Note: Version bump only for package gatsby-plugin-page-creator

4.11.0 (2022-03-29)

🧾 Release notes

Chores

  • replace all uses of gatsbyjs.org with gatsbyjs.com #35101 (16cff41)

4.10.2 (2022-03-23)

Note: Version bump only for package gatsby-plugin-page-creator

4.10.1 (2022-03-18)

Note: Version bump only for package gatsby-plugin-page-creator

4.10.0 (2022-03-16)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-page-creator

4.9.1 (2022-03-09)

Note: Version bump only for package gatsby-plugin-page-creator

4.9.0 (2022-03-01)

🧾 Release notes

Chores

4.8.2 (2022-03-01)

Note: Version bump only for package gatsby-plugin-page-creator

4.8.1 (2022-02-25)

Note: Version bump only for package gatsby-plugin-page-creator

4.8.0 (2022-02-22)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-page-creator

4.7.0 (2022-02-08)

🧾 Release notes

Features

4.6.0 (2022-01-25)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-page-creator

4.5.2 (2022-01-17)

Note: Version bump only for package gatsby-plugin-page-creator

4.5.1 (2022-01-12)

Note: Version bump only for package gatsby-plugin-page-creator

4.5.0 (2022-01-11)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-page-creator

4.4.0 (2021-12-14)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-page-creator

4.3.0 (2021-12-01)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-page-creator

4.2.0 (2021-11-16)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-page-creator

4.1.4 (2021-11-15)

Note: Version bump only for package gatsby-plugin-page-creator

4.1.3 (2021-11-11)

Note: Version bump only for package gatsby-plugin-page-creator

4.1.2 (2021-11-10)

Note: Version bump only for package gatsby-plugin-page-creator

4.1.1 (2021-11-09)

Note: Version bump only for package gatsby-plugin-page-creator

4.1.0 (2021-11-02)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-page-creator

4.0.0 (2021-10-21)

🧾 Release notes

Chores

3.14.0 (2021-09-18)

🧾 Release notes

Features

Bug Fixes

Chores

3.13.0 (2021-09-01)

🧾 Release notes

Chores

3.12.0 (2021-08-18)

🧾 Release notes

Bug Fixes

  • update dependency globby to ^11.0.4 for gatsby-plugin-page-creator #32602 (c8483c4)

Chores

3.11.0 (2021-08-04)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-page-creator

3.10.0 (2021-07-20)

🧾 Release notes

Chores

3.9.0 (2021-07-07)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-page-creator

3.8.0 (2021-06-23)

🧾 Release notes

Chores

3.7.1 (2021-06-10)

Chores

3.7.0 (2021-06-09)

🧾 Release notes

Chores

3.6.0 (2021-05-25)

🧾 Release notes

Bug Fixes

  • support index routes when using the File System Route API #31339 (6ad990c)

3.5.0 (2021-05-12)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-page-creator

3.4.1 (2021-05-05)

Note: Version bump only for package gatsby-plugin-page-creator

3.4.0 (2021-04-28)

🧾 Release notes

Features

  • add support for dynamic routes for API functions #30904 (e44d6a7)

Bug Fixes

  • update minor and patch for gatsby-plugin-page-creator #30824 (4f2b721)

Performance Improvements

3.3.0 (2021-04-14)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-page-creator

3.2.0 (2021-03-30)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-page-creator

3.1.0 (2021-03-16)

🧾 Release notes

Bug Fixes

Chores

  • Fix our internal eslint config for monorepo Fix #29795 (0b4664e)

3.0.0 (2021-03-02)

🧾 Release notes

Features

Chores

2.10.2 (2021-05-04)

Note: Version bump only for package gatsby-plugin-page-creator

2.10.1 (2021-02-24)

Note: Version bump only for package gatsby-plugin-page-creator

2.10.0 (2021-02-02)

🧾 Release notes

Bug Fixes

  • update minor and patch for gatsby-plugin-page-creator #28715 (dcdc68e)

2.9.0 (2021-01-20)

🧾 Release notes

Chores

2.8.1 (2021-01-13)

Note: Version bump only for package gatsby-plugin-page-creator

2.8.0 (2021-01-06)

🧾 Release notes

Bug Fixes

2.7.2 (2020-12-23)

Note: Version bump only for package gatsby-plugin-page-creator

2.7.1 (2020-12-16)

Bug Fixes

2.7.0 (2020-12-15)

🧾 Release notes

Features

Chores

2.6.0 (2020-12-02)

🧾 Release notes

Bug Fixes

2.5.0 (2020-11-20)

🧾 Release notes

Chores

2.4.0 (2020-11-12)

🧾 Release notes

Features

2.3.34 (2020-10-26)

Note: Version bump only for package gatsby-plugin-page-creator

2.3.33 (2020-10-16)

Bug Fixes

  • gatsby-plugin-page-creator: Use correct queryAll name (#27487) (a70a66e)

2.3.32 (2020-10-08)

Bug Fixes

  • gatsby-plugin-page-creator: Update Route API tests & Fix slash replacement (#27335) (2f878d1)

Performance Improvements

  • gatsby-plugin-page-creator: use set for tracking existing files (#27336) (843259e)

2.3.31 (2020-10-06)

Note: Version bump only for package gatsby-plugin-page-creator

2.3.30 (2020-10-01)

Note: Version bump only for package gatsby-plugin-page-creator

2.3.29 (2020-09-28)

Bug Fixes

  • deps: update minor and patch for gatsby-plugin-page-creator (#27130) (bc296ec)

2.3.28 (2020-09-15)

Note: Version bump only for package gatsby-plugin-page-creator

2.3.27 (2020-09-08)

Bug Fixes

  • gatsby: Properly slugify fields with periods (#26787) (bf8ef84)

2.3.26 (2020-09-07)

Note: Version bump only for package gatsby-plugin-page-creator

2.3.25 (2020-08-28)

Note: Version bump only for package gatsby-plugin-page-creator

2.3.24 (2020-08-26)

Note: Version bump only for package gatsby-plugin-page-creator

2.3.23 (2020-08-24)

Note: Version bump only for package gatsby-plugin-page-creator

2.3.22 (2020-08-11)

Bug Fixes

  • gatsby-plugin-page-creator: juggle reporter dont depend on cli (#26357) (2cef73b)

2.3.21 (2020-08-10)

Features

  • gatsby: Extend support for file system pages to build client-only and collections of pages! (#25204) (61d8849)

2.3.20 (2020-08-05)

Note: Version bump only for package gatsby-plugin-page-creator

2.3.19 (2020-07-24)

Note: Version bump only for package gatsby-plugin-page-creator

2.3.18 (2020-07-21)

Note: Version bump only for package gatsby-plugin-page-creator

2.3.17 (2020-07-09)

Note: Version bump only for package gatsby-plugin-page-creator

2.3.16 (2020-07-07)

Note: Version bump only for package gatsby-plugin-page-creator

2.3.15 (2020-07-02)

Note: Version bump only for package gatsby-plugin-page-creator

2.3.14 (2020-07-01)

Note: Version bump only for package gatsby-plugin-page-creator

2.3.13 (2020-07-01)

Note: Version bump only for package gatsby-plugin-page-creator

2.3.12 (2020-06-24)

Note: Version bump only for package gatsby-plugin-page-creator

2.3.11 (2020-06-22)

Note: Version bump only for package gatsby-plugin-page-creator

2.3.10 (2020-06-19)

Note: Version bump only for package gatsby-plugin-page-creator

2.3.9 (2020-06-09)

Note: Version bump only for package gatsby-plugin-page-creator

2.3.8 (2020-06-02)

Note: Version bump only for package gatsby-plugin-page-creator

2.3.7 (2020-05-22)

Note: Version bump only for package gatsby-plugin-page-creator

2.3.6 (2020-05-20)

Note: Version bump only for package gatsby-plugin-page-creator

2.3.5 (2020-05-20)

Note: Version bump only for package gatsby-plugin-page-creator

2.3.4 (2020-05-19)

Note: Version bump only for package gatsby-plugin-page-creator

2.3.3 (2020-05-18)

Note: Version bump only for package gatsby-plugin-page-creator

2.3.2 (2020-05-13)

Note: Version bump only for package gatsby-plugin-page-creator

2.3.1 (2020-05-05)

Note: Version bump only for package gatsby-plugin-page-creator

2.3.0 (2020-04-27)

Note: Version bump only for package gatsby-plugin-page-creator

2.2.4 (2020-04-24)

Note: Version bump only for package gatsby-plugin-page-creator

2.2.3 (2020-04-17)

Bug Fixes

2.2.2 (2020-04-16)

Note: Version bump only for package gatsby-plugin-page-creator

2.2.1 (2020-03-23)

Note: Version bump only for package gatsby-plugin-page-creator

2.2.0 (2020-03-20)

Features

2.1.46 (2020-03-16)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.45 (2020-03-11)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.44 (2020-03-10)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.43 (2020-03-09)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.42 (2020-03-06)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.41 (2020-03-06)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.40 (2020-02-01)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.39 (2020-01-29)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.38 (2020-01-09)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.37 (2019-12-20)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.36 (2019-12-10)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.35 (2019-12-10)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.34 (2019-12-09)

Bug Fixes

  • gatsby-plugin-page-creator: typo in README.md (#20008) (c77d820)

2.1.33 (2019-12-02)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.32 (2019-11-26)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.31 (2019-11-18)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.30 (2019-11-15)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.29 (2019-11-10)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.28 (2019-10-28)

Bug Fixes

2.1.27 (2019-10-14)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.26 (2019-10-14)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.25 (2019-10-09)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.24 (2019-10-04)

Bug Fixes

2.1.23 (2019-09-26)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.22 (2019-09-26)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.21 (2019-09-20)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.20 (2019-09-20)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.19 (2019-09-18)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.18 (2019-09-18)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.17 (2019-09-09)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.16 (2019-09-02)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.15 (2019-09-01)

Bug Fixes

  • update minor updates in packages except react, babel and eslint (#17254) (252d867)

2.1.14 (2019-08-30)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.13 (2019-08-29)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.12 (2019-08-24)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.11 (2019-08-23)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.10 (2019-08-23)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.9 (2019-08-22)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.8 (2019-08-21)

Bug Fixes

2.1.7 (2019-08-21)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.6 (2019-08-20)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.5 (2019-07-13)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.4 (2019-07-12)

Bug Fixes

2.1.3 (2019-07-11)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.2 (2019-07-01)

Note: Version bump only for package gatsby-plugin-page-creator

2.1.1 (2019-06-24)

Features

  • gatsby-page-utils: extract logic for watching a directory from gatsby-page-creator so can reuse for custom page creation (#14051) (68d9d6f)

2.1.0 (2019-06-20)

Note: Version bump only for package gatsby-plugin-page-creator

2.0.13 (2019-05-14)

Note: Version bump only for package gatsby-plugin-page-creator

2.0.12 (2019-03-26)

Features

2.0.11 (2019-03-22)

Bug Fixes

  • gatsby-source-filesystem: pin chokidar@2.1.2 to fix unix issues (#12759) (0ea1505)

2.0.10 (2019-03-11)

Note: Version bump only for package gatsby-plugin-page-creator

2.0.9 (2019-03-05)

Note: Version bump only for package gatsby-plugin-page-creator

2.0.8 (2019-02-22)

Note: Version bump only for package gatsby-plugin-page-creator

2.0.7 (2019-02-19)

Bug Fixes

  • gatsby-plugin-page-creator: Fix regular expression for validate path (#11862) (898873d)

2.0.6 (2019-02-01)

Note: Version bump only for package gatsby-plugin-page-creator

2.0.5 (2018-11-29)

Note: Version bump only for package gatsby-plugin-page-creator

2.0.4 (2018-11-08)

Note: Version bump only for package gatsby-plugin-page-creator

2.0.3 (2018-11-06)

Bug Fixes

  • gatsby-plugin-page-creator: ensure that tests directory is actually ignored (#9720) (a6d17d8), closes #9629

2.0.2 (2018-10-29)

Note: Version bump only for package gatsby-plugin-page-creator

2.0.1 (2018-10-01)

Bug Fixes

2.0.0 (2018-09-17)

Note: Version bump only for package gatsby-plugin-page-creator

2.0.0-rc.5 (2018-09-11)

Note: Version bump only for package gatsby-plugin-page-creator

2.0.0-rc.4 (2018-09-11)

Note: Version bump only for package gatsby-plugin-page-creator

2.0.0-rc.3 (2018-09-11)

Note: Version bump only for package gatsby-plugin-page-creator

2.0.0-rc.2 (2018-09-11)

Note: Version bump only for package gatsby-plugin-page-creator

2.0.0-rc.1 (2018-08-29)

Note: Version bump only for package gatsby-plugin-page-creator

2.0.0-rc.0 (2018-08-21)

Note: Version bump only for package gatsby-plugin-page-creator

2.0.0-beta.5 (2018-07-21)

Note: Version bump only for package gatsby-plugin-page-creator

2.0.0-beta.4 (2018-07-11)

Note: Version bump only for package gatsby-plugin-page-creator

2.0.0-beta.3 (2018-07-11)

Note: Version bump only for package gatsby-plugin-page-creator

2.0.0-beta.2 (2018-06-20)

Note: Version bump only for package gatsby-plugin-page-creator

2.0.0-beta.1 (2018-06-17)

Note: Version bump only for package gatsby-plugin-page-creator

2.0.0-beta.0 (2018-06-17)

Note: Version bump only for package gatsby-plugin-page-creator