Overview
Chapinismos is built with Astro 5 and follows a traditional Astro project structure with content collections, file-based routing, and reusable components.Root Directory Structure
Source Directory (src/)
Detailed Component Structure
Core Components (src/components/)
Homepage Components (src/components/home/)
Schema Components (src/components/schemas/)
JSON-LD structured data for SEO:
Public Assets (public/)
Configuration Files
astro.config.mjs
Defines Astro build configuration, integrations, and i18n settings.
src/content/config.ts
Defines the schema for content collections.
File Organization Conventions
Component Naming
- Use PascalCase for component files:
WordCard.astro,HeroSection.astro - Group related components in subdirectories:
home/,schemas/,icons/ - Keep component files focused on a single responsibility
Content Organization
- Separate content by language:
words-es/,words-en/ - Use kebab-case for content file slugs:
chispa.md,chunche.md - Define frontmatter schema in
content/config.ts
Utility Functions
- Place shared utilities in
src/utils/ - Use descriptive names:
categoryColors.ts,i18n.ts - Export pure functions when possible
Styles
- Global styles in
src/styles/global.css - Component-scoped styles within
<style>tags in.astrofiles - Use CSS custom properties for theming
Build Output
When you runpnpm build, Astro generates:
Key Directories Explained
| Directory | Purpose | Examples |
|---|---|---|
src/components/ | Reusable UI components | Header, Footer, WordCard |
src/content/ | Content collections (MD/MDX) | Word definitions |
src/layouts/ | Page layout wrappers | Base.astro |
src/pages/ | File-based routing | index.astro, [slug].astro |
src/utils/ | Helper functions | i18n, colors |
public/ | Static assets (copied as-is) | Images, fonts, icons |
Next Steps
Pages & Routing
Learn how file-based routing works
Components
Explore the component architecture
Layouts
Understand layout structure
Content Collections
Work with content collections