Enhancing Content Collection Structure in Astro #801
Replies: 2 comments 4 replies
-
Thanks for sharing this detailed example! We're exploring deeper changes to content collections right now to break out of the "top-level directory" requirement. Noted |
Beta Was this translation helpful? Give feedback.
-
Thanks for sharing this @scriptogre! Happy to share we overhauled collection configs for the new Content Layer. We introduced "loaders" to unlock total flexibility over where your content lives. We include a I created an example project showing how this might work. I will note that the generated Check out the example on Stackblitz I'm also marking this discussion as "closed." If you have any feedback for us, feel free to share on discord or start a new discussion. Appreciate the solutions everyone! |
Beta Was this translation helpful? Give feedback.
-
Body
Issue Description
Background
In my Astro project, I'm developing a course structure with chapters and lessons, each having its own metadata. I'm aiming to organize the course content in a way that logically groups lessons under their respective chapters, with both chapters and lessons maintaining individual metadata. However, Astro's current content collection system poses challenges in achieving this clear, logical, and maintainable folder structure.
Attempted Solutions & Challenges
(Current) Splitting Content into Separate Collections:
course_chapters
(YAML) andcourse_lessons
(Markdown):(Proposal) Nesting Collections under Parent Folder:
chapters
(YAML) andlessons
(Markdown) under a parentcourse
folder (which is NOT a collection):content
folder.(Hypothetical) Unified Mixed Collection:
courseChapters
andcourseLessons
under a mixed collection, maintaining separate schemas but unified under one umbrella.Conclusion
These enhancements would greatly benefit projects requiring complex content organization and provide more versatility in managing diverse content types in Astro. I am eager to hear the community's thoughts on these proposals, especially the third option. Thank you for considering this feature request.
Beta Was this translation helpful? Give feedback.
All reactions