CONTENT MANAGEMENT
YAML-DRIVEN CONTENT SYSTEM
FYT uses a YAML-based content system that separates content from presentation. Write once, render everywhere: web, print, API responses.
INTRODUCTION
Why YAML for content?
FYT's content management system is built on YAML files that define structured content. This approach provides:
- Separation of concerns: Content lives separately from code
- Type safety: Structured data with validation
- Multi-format rendering: Same content renders to web, print, and APIs
- Version control friendly: Plain text files work perfectly with Git
- No database required: Static content, blazing fast builds
Philosophy:
Content should be easy to write, easy to read, and easy to maintain. YAML provides a human-friendly format that's also machine-parseable.
CONTENT DIRECTORY STRUCTURE
Where content lives
TEXT
content/
├── pages/ # Page content
│ ├── home.yaml
│ ├── about.yaml
│ ├── build.yaml
│ └── docs/ # Documentation pages
│ ├── docs.yaml
│ ├── guides/
│ ├── technical/
│ └── audits/
├── components/ # Component documentation
│ ├── button.yaml
│ ├── card.yaml
│ └── typography.yaml
├── blog/ # Blog posts
│ ├── 2025-01-15-welcome.yaml
│ └── 2025-01-20-brutal-design.yaml
├── design-tokens/ # Design system tokens
│ ├── colors.yaml
│ ├── spacing.yaml
│ └── typography.yaml
└── config/ # Site configuration
└── site.yamlDirectory Purposes:
| Directory | Purpose | URL Pattern |
|---|---|---|
| `pages/` | Static pages | `/about`, `/build` |
| `pages/docs/` | Documentation | `/docs/*` |
| `components/` | Component docs | `/components` |
| `blog/` | Blog posts | `/blog/:slug` |
| `design-tokens/` | Design tokens | `/design-tokens` |
| `config/` | Site config | N/A (internal) |
FILE NAMING CONVENTIONS
How files map to URLs
Pages:
File path determines URL:
content/pages/about.yaml→/aboutcontent/pages/build.yaml→/buildcontent/pages/docs/guides/print-optimization.yaml→/docs/guides/print-optimization
Blog Posts:
Date-prefixed filenames:
content/blog/2025-01-15-welcome.yaml→/blog/welcome(slug:welcome)content/blog/2025-01-20-brutal-design.yaml→/blog/brutal-design
Slug Override:
Use
meta.slug to override automatic URL generation:YAML
meta:
slug: "/custom-url"YAML TO RENDERED PAGE
How content becomes a page
Content Flow:
- Write YAML: Create/edit
.yamlfile incontent/directory - Validate: Run
./fyt validateto check syntax and structure - Build: esbuild imports YAML at build time via custom plugin
- Render: React components render YAML data
- Deploy: Static HTML/CSS/JS bundle
Example YAML Structure:
YAML
meta:
title: "Page Title"
description: "Page description for SEO"
slug: "/example"
hero:
title: "HERO TITLE"
subtitle: "Hero subtitle"
lead_text: "Lead paragraph"
sections:
- id: "section-1"
type: "content"
title: "Section Title"
content: |
Markdown content here
variant: "brutal"Rendering Components:
meta→ Page metadata, SEO tagshero→ Hero section with title/subtitlesections→ Array of content sectionsvariant→ Styling (brutal, electric, resistance, humanist)
NEXT STEPS
Learn More:
- CLI Reference - Complete CLI documentation
- Creating Content - Step-by-step guides
- Editing Content - Editing workflows
- Styling & Variants - Styling options
- Content Validation - Validation guide