Source Code and Setup Instructions for this site.
2017-10-21

I recently rewrote my website using a static site generator. This is the source code for my website, and here are the features / setup-instructions.

Description

  • It is a static site, based on staticjinja.

  • Content is written in HTML or markdown, and served as HTML5 files with an (almost) vanilla bootstrap layout.

  • Your file directory structure is preserved. Binary files are directly copied, and the rest are passed through Jinja2.

Source code

I use a heavily customized build script (available here) to provide the following:

  • Render markdown with lots of extensions (MathJax, wikilinks, breadcrumbs, etc.).

  • Allow using Jinja2 templates in markdown.

  • Provide globbing functions (accessible via Jinja2) to display lists of files.

  • Use a YAML site configuration file

  • Only render files based on modification times for speed (configurable).

Setup Instructions

  • To download use

    git clone --recursive https://gitlab.com/gi1242/sjinja-www.git
    

    (Don’t forget --recursive, otherwise you will have to run git submodule update --init to update the submodules.)

  • Edit site.cfg and put in your URL / defaults.

  • Generate the site by running build.py. Use build.py -h for options. Pass regexps on the command line to force re-rendering of certain files.

Editing instructions

  • Generic Markdown syntax can be found here.

  • Site specific markdown extensions and macros can be found here.

  • The current layout and structure is described here. (You can ignore this if you plan to just write in Markdown, or want to create your own layouts from scratch.)

Bugs

  • 2017-10-21: Continuously watching for changes with -w isn’t perfect. Any file you change is always re-rendered, but the dependencies and changes to meta-data are ignored. I’m not interested in fixing this. Re-running the build script (without -w) renders everything correctly.

 Comments

 Leave a comment (Spammers beware: All comments are moderated)