Build your next static web site with Statik

Step 1

Define your data models and instances in YAML and Markdown

Step 2

Code your Jinja2/HTML templates and YAML views

Step 3

Run statik and enjoy your shiny new static site

 

Why Another Static Site Generator?

As is evident in the sheer number of static site generators available (see StaticGen), everyone's got an opinion as to how to build a static site generator, and what sorts of conventions to favour over configuration. Beyond the desire to make stuff, why build another one?

Most popular static site generators, like Jekyll or Pelican, are generally geared towards building blogs. Their taxonomies include terms such as Articles, Pages, Tags and Categories. This is great if you're building a blog or a small site with a few pages, but what if you want to do something a little more custom? Or what if you want to come up with your own taxonomy and way of organising your content? There are ways you can "force-fit" your taxonomy to those provided, such as clever usage of the Tags and Categories concepts, or you may need to go as far as building your own plugins for your generator.

Hugo, for example, is great for defining custom taxonomies, but it's still quite an involved process when you come from a background where you have experience in building relational databases and keep thinking to yourself: "If only I could just define my own relational data model here, I'd be able to ..."

That's where Statik comes in. For example, if you wanted a Post model, you'd define it yourself:

# models/Post.yml
title:   String
slug:    String
summary: Text
date:    DateTime
content: Content

Is your curiosity piqued at all? If so, read on, and check out the documentation for more details.

 

Comparing Statik to Other Static Site Generators

Here's a bird's-eye comparison of some of the high-level features supported by Statik as compared to a handful of the other popular static site generators available today.

Feature Statik Pelican Jekyll Hugo
Fully customisable data model
Custom ORM-style data queries
Build complex, non-blog static sites
Built-in hot reload server for testing
Markdown support
reStructured Text support
Custom taxonomies
Custom plugin support
Template engine Jinja2 Jinja2 Liquid html/template
Written in Python Python Ruby Go
 

Installation

Make sure you've got Python 2.7+ or 3.5+ and the latest version of Virtualenv for your platform.

# Set up your virtual environment using Python 3
> cd /path/to/your/project
# For Python 2, do "virtualenv -p python2" instead of the following
> virtualenv -p python3 .
# Activate the virtual environment
> source bin/activate
# Install Statik from PyPI
> pip install statik
# Run Statik in your project's folder to build your static site into the
# "public/" folder inside your project
> statik

If you really wanted to, you could install Statik globally, but it's generally recommended (to avoid dependency conflicts) to install Python applications in their own virtual environments.

 

Creating a New Project

To create an empty Statik project in a folder, it's as easy as:

> statik --quickstart
 

Built-in Web Server and Hot Reloading

Statik provides a built-in server to serve your built static site's content, along with hot reloading to automatically monitor your project for changes and reload your site in your browser. By default it serves your content from http://localhost:8000.

> statik --watch
 

Coming Soon

Themes will be coming soon, so watch this space!

 

Learn More

See the documentation for more details, and the repository for the code.