How do I create this nested page structure? #27875
Unanswered
hamishtaplin
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to figure out how to use the following structure of pages:
Using this structure, I want to create 2 content "types", with associated templates
/projects/category1/index.md
)/projects/category1/project1/index.md
)I have
gatsby-source-filesystem
configured to pull all my pages in from a folder (content)In
gatsby-node
I need to write 2 queries that will match the category pages and the project pages so I can feed them to different templates viacreatePage
to generate the pages.I also need to create a few different types of navigation, eg.
All the category indexes:
All the pages with the current category (via the category slug, eg.
category1
)All the projects
I'm pretty sure all of this can be done via a Regex on
fileAbsolutePath
. For example, this simply gets everything in theprojects
folder.What I have no idea how to do is to
category1
) get all of it's childrenBeta Was this translation helpful? Give feedback.
All reactions