View on GitHub

Anatolik

Funny static blog engine

Download this project as a .zip file Download this project as a tar.gz file

Anatolik is a tool that helps you to build your own static site.

It's build for me by me and I don't think it will fits your needs. As a person with heavy NIH syndrom I was not satisfied with existing static blogging systems, so I made my own. Yay!

My needs:

None of existing static blogging platforms have fit me, so here where I am and that's why I'm releasing this.

Dependencies

How it works

Anatolik operates on Site with Posts, Layouts and Pages.

    +------------------------+
    |                        |
    |         Page           |
    |                        |
    |      (Pure HTML)       |
    |                        |
    +------------------------+
                ^
                |
                |
       Templates processing
                |
         Content insertion
                |
                |
    +------------------------+
    |                        |
    |        Layout          |
    |                        |
    |   (HTML + Templates)   |
    |                        |
    +------------------------+
                ^
                |
                |
       Templats processing
                |
       Translation to HTML
                |
                |
    +------------------------+
    |                        |
    |        Content         |
    |                        |
    | (Markdown + Templates) |
    |                        |
    +------------------------+

From the top view compilation process is following

  1. Build site map. Site map is hash map accessible from every component that contains:

    • Configuration;
    • Paths to posts, layouts, output, assets;
    • Lists of content posts, layouts objects (filled during processing).

    Mainly this map is used in templates such as %{ site.url } or %{ site.posts['some-post'] }.

  2. Process layouts. For every layout:

    • Parse layout file and instantiate Layout object;
    • Render layout templates.
  3. Process posts. For every content post:

    • Parse post file and instantiate Post object;
    • Render post templates;
    • Convert to HTML.
  4. For every post.

    • Instantiate Page object from post and corresponding layout;
    • Insert post in layout;
    • Store Page in output directory under given directory.
  5. Put assets in output.

Templating

Templating is done with Mako templates.

Each post are given 2 dictionaries:

  1. site - global configuration object. site members:
    • posts - list of all posts
    • layouts - list of all layouts
    • url - site URL
  2. post - current post object