Advanced Features

See what SiteGen can do with data and logic.

Data Sorting & Limiting

Here we load `data/links.json`, sort it by name descending, and limit to 3 items.

range sort "name" "desc" (limit 3 (data "links.json"))
  • Home - /
  • Features - /features
  • Blog - /blog

File Sources

Dynamically listing files from `src/img` using `sources`.

File Handlers

Check `src/css/styles.css` frontmatter to see how we handle file-specific build commands.

/*
---
serve: echo "Serving CSS..."
build: echo "Building CSS..."
---
*/