Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

314
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda