Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

310
Views
Gatsbyjs - Define Location of Static Pages as Something Other than the 'pages' folder

As the title states, I'm unsure if it is possible to customize the folder Gatsby looks into to generate static pages. Apparently, this seems to be fixed without the ability to change from the pages/ folder. Ideally, this could be changed with something like an environment variable or similar. On the existing docs (https://www.gatsbyjs.com/docs/creating-and-modifying-pages/) nothing like this is mentioned.

Does anybody know if this is possible and I've just missed it somewhere? I've also opened this feature request discussion on the Gatsby GitHub: https://github.com/gatsbyjs/gatsby/discussions/35727

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can use the gatsby-plugin-page-creator (official plugin from Gatsby staff) to customize the source of the /pages folder. Simply use it as:

{
  resolve: `gatsby-plugin-page-creator`,
  options: {
    path: `${__dirname}/src/account/pages`,
  },
}

Or using environment files:

{
  resolve: `gatsby-plugin-page-creator`,
  options: {
    path: `${__dirname}/src/${process.env.A_FOLDER_NAME}`,
  },
}

You can even use multiple instances of the plugin or ignore some files with the ignore option.

I've tested it recently and worked like a charm.


The final configuration for this answer was:

{
  resolve: `gatsby-plugin-page-creator`,
  options: {
    path: `${__dirname}/src/pages`, 
    ignore: [`*`]     
  },
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!