Getting Started with lyt
Quick start guide for AI agents setting up lyt
Installation
# Install via Go
go install github.com/b7r-dev/lyt@latest
# Verify installation
lyt --version
Alternative: Build from Source
# Clone and build
git clone https://github.com/b7r-dev/lyt
cd lyt
go build -o lyt .
./lyt --version
Global vs Local Usage
Globally installed (go install):
Run lyt from any directory. Content path defaults to current dir.
Working in lyt repo (development/contributing):
cd lyt
go run . build -o ../dist
Create Project
# Create new project (global install)
lyt init my-site
cd my-site
lyt build
lyt serve -p 8080
Project Structure
my-site/
├── content/ # Your pages, blog posts, config
│ ├── pages/
│ ├── blog/
│ ├── config/
│ └── tokens.yaml
├── templates/ # HTML/CSS templates
│ └── base.css
└── public/ # Static assets (images, fonts)
Content/Style/Engine Split
lyt maintains clear separation:
- content/ - YAML + Markdown. No code, just data.
- templates/ - HTML structure + CSS. No content, just markup.
- cmd/, internal/ - Go code. No content, no templates.
This means: same engine, different content/style = different sites.
AI Agent Prompt for Users
# Copy this prompt and give to VS Code/Cursor/Codex:
I want to create a static site using lyt (github.com/b7r-dev/lyt).
1. Install lyt: go install github.com/b7r-dev/lyt@latest
2. Create project: mkdir my-site && cd my-site && lyt init
3. Edit content/pages/index.yaml - change hero title to "My Site"
4. Add content/pages/about.yaml with hero section
5. Build: lyt build
6. Open dist/index.html to verify
Validate Content
# Validate content files
lyt validate
# Validate before building (recommended)
lyt build --validate
# Strict mode
lyt validate --strict
Schema Validation
lyt validates content against content/schema.yaml.
Schema enforces:
- Required fields (title, slug)
- Valid section types
- Field formats
Run validation in CI to catch errors early.