Table of Contents
- 📁 Applications
Blg Volta - 📁 Development
-
📁 Astro
Blg Directory Structure Of Blogs Collection Blg Astro Errors Blg Imagemetadata Blg Links Blg Search Tool -
📁 T4
Blg Custom Output Blg Editors Blg Template Content
Blg Chocolatey Blg Web Resources Blg Git Commands -
📁 Astro
- 📁 Food
- 📁 Hardware
- 📁 Helpful
- 📁 Keyboard
-
📁 Ergogen
Blg Articles Blg Footprints Blg Get Keyboard Layout File From Ergogen Blg Ergogen Links Blg Mounting Hole In Outline
Blg Build Guides Blg Components Blg Kicad Examples Blg Keyboard Roadmap Blg Index Blg Keylayer Plate Thickness Blg Splitkb Blg Tools -
📁 Ergogen
| Blg | Roadmap |
directory structure of blogs collection
published: 2026-04-13
The directory structure for an Astro blog collection follows a specific convention centered around the src/content/ directory.
Blog Collection Structure
The blogs collection is created as a top-level directory within src/content/. Each Markdown (.md) or MDX (.mdx) file inside represents a blog post.
Standard Directory Layout
src/
├── content/
│ └── blog/ # The blog content collection
│ ├── first-post.md
│ ├── second-post.md
│ └── draft-post.md # Can be excluded with a leading underscore (_)
├── content.config.ts # Configuration file for defining collections and schemas
├── pages/
│ ├── index.astro # Homepage
│ └── blog/
│ └── [slug].astro # Dynamic route template for individual blog posts
└── ...
Key Points
src/content/blog/: This folder is the designated collection for all blog posts.- File Naming: Use lowercase with dashes (e.g.,
my-first-blog-post.md) for consistency. content.config.ts: This file (located insrc/) is used to define the blog collection and its schema for type safety.- Dynamic Routing: The
[slug].astrofile insrc/pages/blog/is used to generate individual pages for each post based on its filename or frontmatter slug.