Search documentation...

Project Structure

Understanding how a Velt project is organized.

Directory Layout

A typical Velt project has the following structure:

my-project/
β”œβ”€β”€ content/          # Your pages (.vdx files)
β”‚   β”œβ”€β”€ index.vdx
β”‚   β”œβ”€β”€ about.vdx
β”‚   └── docs/         # Nested directories become nav sections
β”‚       └── intro.vdx
β”œβ”€β”€ layouts/          # V layout templates
β”‚   β”œβ”€β”€ default.v
β”‚   └── landing.v
β”œβ”€β”€ components/       # Reusable V components
β”‚   β”œβ”€β”€ callout.v
β”‚   └── hero.v
β”œβ”€β”€ assets/           # Static files (CSS, images, etc.)
β”‚   └── style.css
└── dist/             # Generated HTML output

Content Directory

The content/ directory contains your .vdx files. Each file becomes a page.

Nested Directories

Subdirectories create navigation sections:

content/
β”œβ”€β”€ index.vdx           β†’ /index.html
β”œβ”€β”€ docs.vdx            β†’ /docs.html
└── guides/
    β”œβ”€β”€ setup.vdx       β†’ /guides/setup.html
    └── advanced.vdx    β†’ /guides/advanced.html

Layouts Directory

Layouts are V source files that define the HTML structure. They receive:

  • content - The rendered page content
  • title - From frontmatter
  • nav_html - Auto-generated navigation

Pages with layout = "landing" are excluded from navigation.

Components Directory

Components are reusable V structs with a render() method. Use them in your .vdx files:

<Callout type_="warning">
This is a warning message.
</Callout>

Assets Directory

Static files like CSS, JavaScript, and images. They're served at /assets/.

Dist Directory

Generated HTML output. Deploy this directory to your hosting provider.