Zola

Zola
Everything you need to make a static site engine in one binary.

If you're building a static site, there are a lot of options out there. Zola (code) a great way to get started quickly and build a site that looks great and is easy to manage.

Zola is built in Rust, so it's about as fast as anything you'll find in other languages which means speedy site building for you.

Along with rock solid reliability and performance, Zola comes with a bunch of themes to make your next site look awesome:

Zola themes page (source: https://https://www.getzola.org/themes)

Getting started with Zola

It's easy, after you've installed Zola, you can follow the getting started guide and start with a simple command:

$ zola init your-blog-name

zola asks a bunch of questions about your blog that are easy to answer, and you get a directory layout that looks like this with content in it:

your-blog-name
├── config.toml
├── content/
│   └── blog/
│       ├── _index.md
│       ├── first.md
│       └── second.md
├── sass/
├── static/
├── templates/
│   ├── base.html
│   ├── blog-page.html
│   ├── blog.html
│   └── index.html
└── themes/

Once you're ready, you can serve your site locally very easily:

$ zola serve
Building site...
-> Creating 0 pages (0 orphan), 0 sections, and processing 0 images

Zola's default port is 1111, so you can head to http://localhost:1111 to so your website.

Deploying a site built with Zola

Once you've got a site built out with Zola you can run zola build to export it to a form that you can easily host.

Here's a simple Dockerfile you could use to build a caddy-powered image and serve your site.

# alpine:3.16.3 as of 2022/12/01
FROM alpine:sha256:3d426b0bfc361d6e8303f51459f17782b219dece42a1c7fe463b6014b189c86d AS builder

# Yup, alpine support Zola
# https://pkgs.alpinelinux.org/package/edge/community/x86_64/zola
apk add zola

# Copy in your code
COPY . /site
WORKDIR /site

# Run the site afresh inside the container
RUN zola build

# caddy:2.6.2-alpine as of 2022/12/01
FROM caddy:alpine@sha256:7992b931b7da3cf0840dd69ea74b2c67d423faf03408da8abdc31b7590a239a7

COPY --from=builder /site/public /usr/share/caddy

Of course these days it's a good idea to use the power of CDNs and other solutions as well, Zola's got your covered in their deployment documentation.