-
Notifications
You must be signed in to change notification settings - Fork 360
Issue: 404 Error When Using Subfolders in the Blog Directory #64
Copy link
Copy link
Open
Description
I am trying to organize my blog posts into subfolders under the /blog directory. The home page correctly lists all posts, but clicking on any post inside a subfolder results in a 404 error. It seems like the routing is broken.
Expected Behavior:
- Posts inside subfolders should be accessible via their respective URLs.
- The home page should continue listing all posts correctly.
Current Structure:
/src/content/blog/
├── category1/
│ ├── post-1.md
│ ├── post-2.md
├── category2/
│ ├── post-3.md
│ ├── post-4.md
├── post-5.md
Questions:
- What changes are required in routing or collection settings to make subfolder posts accessible?
- Do I need to modify
astro.config.mjsor thegetCollection()function? - Should I adjust the
sluggeneration logic inpages/blog/[slug].astroto account for subfolders?
I expect to have around 40+ blog posts, so organizing them into subfolders is necessary for better management. Please suggest the best approach to make this work.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels