Rista

Introducing Rista

A cut ruby on a stack of printed pages, in morning sunlight.

Rista is a static site generator for Ruby. It renders a directory of routes to plain HTML files, with hashed CSS, JavaScript and image assets beside them.

It is built on Klenod, a module bundler for Ruby. Klenod loads Ruby, Haml, Markdown, CSS, TypeScript and image files as modules and provides a file-based router. Rista adds the part that turns a route into an HTML string, and writes the result to disk.

What you get

  • Pages written in Haml, and content written in Markdown with front matter
  • Routes from the file system, including routes with params
  • Stylesheets scoped to one template
  • Hashed assets that can be cached forever
  • Images in several widths and formats, with the srcset written for you
  • Google Fonts downloaded once, then served from the site
  • A description and Open Graph tags for each page, from the page itself or from its front matter
  • An Atom feed, a sitemap and 404 pages
  • A build that fails on a link to a page the site does not have
  • A development server that reloads the browser on change
  • An nginx config generated for the built site, and a command that sets up a deploy to Cloudflare or GitHub Pages

What you do not get

There is no client runtime and nothing is hydrated. A page’s JavaScript is whatever its modules import, and a page that imports none still works.

There is also no content model. A post is a Markdown file, its front matter is whatever the site decides it is, and tags or archives are ordinary routes. The documentation shows how, and this site is the worked example.

Trying it

Getting started takes a new directory to a built site.