Skip to content


Folders and files

Last commit message
Last commit date

Latest commit



32 Commits

Repository files navigation

genox - extremely simple static site generator

Because simplicity is a virtue.

Why yet another static site generator?

I've used Jekyll, Hugo, Gatsby, Pelican, and countless other static site generators for multiple websites.

I've disliked every single one of them.

  • Some are too simple, and some are way too complex.
  • Some have incomplete docs, some have complex docs.
  • Some are opiniated, some are way too barebones.

Genox is my solution to my painpoints in dealing with other SSGs.


  • Follow the Zen of Python, as close as possible.
  • Code over configuration.
  • Forkable.
  • Keep it simple. Reeeeeeeeeeeealy simple.


All config is stored in config.yml file. It needs to be in the same directory as which is considered the root directory.

# The directory where actual content stays
input_dir: content

# The directory where our jinja templates stay
layout_dir: layouts

# The directory where our static files (assets) stay
# eg. css, js, images, etc.
# We want to place files in static directory which do not need
# to be processed.
static_dir: static

# The final produced site goes in there.
output_dir: _build

# these are the default values used for file-specific
# configuration
  layout: post
  author: ox

# these are site-specific values available under the
# config['site'] variable or {{ site }} in templates
# tl;dr these are user customizable config values
  title: "genox - such k00l much w0w"
  description: "Now this is the story all about how my site got flipped..."
  google_analytics_id: "GA-WOW"

# markdown extension you want to process
  - '.md'
  - '.mkd'
  - '.markdown'
  - '.rst' # rst is not supported but maybe your markdown files end with rst?

# manifest file used for reading dynamic static bundles from the js world
manifest_file_name: "manifest.json"

How genox builds the site?

There is no default directory structure. The specific names are configurable in the config.yml file.

Structure for our input_dir is a little opiniated.

Genox will recurse into all directories and map it exactly the same in the output site. While roaming through the input dir, it will check for all markdown files (specified using md_ext config).

It will then process each markdown file expecting them to be in a format like this:

title: "Markdown title"
date: 2020-02-20
myvar: myvalue
    - hook1
    - hook2

This is my blog post.

## Heading 2

Anything in this part of the markdown file will be available
to our templates as the {{ content }} variable and be rendered
as markdown content

So for example I can have a file in my input_dir as follows:


and it will be available in our website at

Please note the trailing slash. What genox will do is create the output file in a structure as follows:


What about subdirectories?

Any subdirectory will be automatically be created in output site.

For example:





But what if now you also want to put something at

This is where we use a special file called





All non markdown files will be copied to output site preserving the directory structure.

What if we want to access a list of people in the about directory in the about/ i.e. basically we want to create an index page.

Well customizations like this is where hooks come in. Read more below.




Installing genox from pypi is as simple as:

pip3 install genox

This installs a script named genox which can be used directly on the command line:

cd ~/www/
# ^this should give you an error as we have not yet added a config.yml file

Now copy config.yml from this repo in to your project directory.

Originally genox was meant to be forked (the real reason is I am lazy and python doesn't make it easy to publish packages). The code is very small, easy to read. Just fork this repository in your website root and start hacking.

But I got fedup of cloning genox on different systems, and decided to set it up on pypi anyways.

Another way to install

I personally don't use the pypi version. I instead use pip install -e ~/projects/genox, this way all my sites directly use the most latest code in genox. I can change the source and get updates instantly across all my sites.

I would recommend you fork genox and do the same. Genox is extremely hackable.

Moar Features

Manifest - Integration with Node ecosystem

To be able to integrate genox with javascript ecosystem which bundle css/js files into bundles, we use a manifest file. The file with manifest_file_name must be preset in project root. It will be read and be available in the {{ _config.manifest }} template variable.


When DEBUG environment variable is set to 1, a debug flag is set which can be accessed using {{ _config.DEBUG }} template variable.

$ DEBUG=1 genox

Example of Manifest and Debug - Here during development we use out.css as is. But for production our asset pipeline could be producing a hashed file (eg: out.Has7d6h3Jdesa.css which gets written to the manifest file by our node builder.

Genox can then read that file from the manifest and use it in template.

  {% if _config.DEBUG %}
  <link href="/static/bundle/out.css" rel="stylesheet">
  {% else %}
  <link href="/static/bundle/{{ _config.manifest["out.css"] }}" rel="stylesheet">
  {% endif %}

Production Deployment


Here is a sample nginx location block to serve sites built using genox

    location / {
        root /srv/{{ build_dir }};
        index index.html index.htm;
        autoindex off;
        add_header Last-Modified $date_gmt;
        add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
        if_modified_since off;
        expires off;
        etag off;
        try_files $uri $uri/ $uri.html =404;


vim plugin

Genox comes with it's very own, very bad, unsuable vim-plugin!

Check it out here:

Share some <3

“Pare down to the essence, but don't remove the poetry.” ― Leonard Koren

Please leave a star :)