Content Guide

lyt

Structure your content with YAML frontmatter and sections.

Project Structure

A lyt project has this structure:

my-site/
├── content/
│   ├── pages/        # Page YAML files
│   ├── blog/        # Blog post YAML files
│   ├── config/      # Site configuration
│   └── tokens.yaml  # Design tokens
├── templates/
│   └── base.css    # Stylesheet
├── public/         # Static assets
└── dist/          # Built output

Configuration →

Page Structure

Every page is a YAML file with two parts: meta and sections.

meta:
  title: "Page Title"
  slug: "/about"
  description: "SEO description"

sections:
  - id: "intro"
    type: "default"
    title: "Introduction"
    body: |
      Your content here.

Frontmatter Fields

The meta section defines page metadata:

Field Required Description
title Yes Page title
slug Yes URL path (e.g., /about)
description No SEO meta description
date No Publication date (blog only)
tags No Array of tags (blog only)
draft No Set true to exclude from build

Section Types

Sections define content blocks. Available types:

Type Purpose
default Standard text content
hero Full-width page opener
features Grid of feature cards
callout Info/tip/note box
pull-quote Blockquote
cta Call-to-action banner
warning Alert box
code-example Syntax-highlighted code

Full component reference →

Default Section

The most common section type:

sections:
  - id: "intro"
    type: "default"
    title: "Introduction"
    body: |
      Your content in **Markdown**.
      
      - Lists
      - Work too

Hero Section

Create impactful page openers:

sections:
  - id: "hero"
    type: "hero"
    title: "Page Title"
    subtitle: "Optional subtitle"
    body: "Brief intro text."
    buttons:
      - text: "Primary Action"
        href: "/page"
        variant: "primary"
      - text: "Secondary"
        href: "/other"
        variant: "outline"

Button variants: primary, outline

Features Section

Display a grid of feature cards:

sections:
  - id: "features"
    type: "features"
    title: "Why Choose Us"
    cards:
      - title: "Feature One"
        body: "Description of the feature."
      - title: "Feature Two"
        body: "Another great feature."

Markdown in Body

All body fields support Markdown:

body: |
  # Heading
  
  Paragraph with **bold** and *italic*.
  
  - List item
  - Another item
  
  [Link text](https://example.com)
  
  > Blockquote

body vs content

Use body for inline content (recommended):

sections:
  - id: "intro"
    type: "default"
    title: "Introduction"
    body: |
      Your content here. **Markdown** works.

Use content for external Markdown files (advanced):

sections:
  - id: "long"
    type: "default"
    title: "Long Article"
    content: "@blog/my-article.md"

The @ prefix references a file in content/pages/ or content/blog/.

When to use which?

Field Use Case
body 99% of cases. Short to medium inline content.
content Very long content in separate file, or content managed by non-YAML tools.

Blog Posts

Blog posts go in content/blog/:

meta:
  title: "My Post"
  slug: "my-post"
  date: 2024-01-15
  tags:
    - tutorial
    - lyt
  draft: false

sections:
  - id: "intro"
    type: "default"
    body: |
      Your blog post content...

Learn Components

Dive deeper into the component library for rich content.

Component Reference