Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Blogatto

logo

Package Version Hex Docs conventional-commits target-erlang test

A Gleam framework for building static blogs with Lustre, Markdown, and Djot.

Blogatto generates your entire static site from a single configuration: blog posts from Markdown (.md) or Djot (.dj/.djot) files with YAML frontmatter, static pages from Lustre views, RSS and Atom feeds, sitemaps, and robots.txt — all rendered via Maud components.

Features

  • Blog posts from Markdown or Djot — write in either format with YAML frontmatter, Blogatto handles parsing, rendering, and output
  • Multilingual support — add index-it.md, index-fr.md, etc. alongside index.md for language variants
  • Static pages — map URL paths to Lustre view functions that receive the full list of blog posts
  • RSS and Atom feeds — generate one or more RSS 2.0 and Atom 1.0 feeds with optional filtering and custom serialization
  • Sitemap XML — automatic sitemap generation covering static pages and blog posts
  • Robots.txt — configurable crawl policies with sitemap reference
  • Custom rendering — override any Markdown or Djot element’s HTML output via shared Maud components
  • Build-time syntax highlighting — highlight code blocks at build time via Smalto, with 28 built-in languages and customizable token rendering
  • Custom post routing — control blog post URLs with a route builder function for date-based, category-based, or any custom URL scheme
  • Blog post templates — full control over the page layout wrapping each blog post
  • Static asset copying — copy CSS, images, and other assets into the output directory

How it works

You define a Config using the builder pattern, then call blogatto.build(config). The build pipeline:

  1. Cleans and recreates the output directory
  2. Copies static assets
  3. Generates robots.txt
  4. Parses post source files (Markdown or Djot), extracts frontmatter, renders HTML, and copies post assets
  5. Renders static pages from route view functions
  6. Generates RSS and Atom feeds
  7. Generates sitemap XML

The output is a fully static site ready to deploy to any static hosting provider.

Documentation

GuideDescription
Getting startedInstallation, project setup, and your first build
Example blogWalkthrough of the complete example project
Blog postsDirectory structure, frontmatter, multilingual support
ConfigurationFull configuration reference
Post componentsCustomizing Markdown and Djot rendering
Syntax highlightingBuild-time code block highlighting with Smalto
Static pagesRoutes, view functions, and using post data
RSS feedsRSS 2.0 feed configuration, filtering, and serialization
Atom feedsAtom 1.0 feed configuration, filtering, and serialization
Sitemap and robots.txtSitemap and crawler configuration
Dev serverFile watching, auto-rebuild, and live reload
Error handlingError types and recovery patterns

API reference

Full API documentation is available on HexDocs.