Thera

A Python script for building static HTML websites from Markdown text files, using the Mako template engine. Excellent support for blogs: allows YAML metadata in the blog markdown files, can create an Atom-compatible RSS feed.

Why use it?

Minimalist design reduces maintenance headaches.

How to install it

pip3 install thera

How to use it

thera <markdown file(s)>

Options

-b --blog             Blog index template path.
-c --config           Configuration file path.
-h --help             Show help.
-r --rss              Blog RSS template path.
-s --static           Static directory paths (javascript, css).
-t --template         Page template file path.
-v --version          Show version number.

YAML

YAML can be used in the markdown files:

---
Title: Hello world
Date: 09 Apr 2018 07:00 AM -0400
Slug: hello
Summary: A new blog for tech, business, and other oddments.
---
Hello. This is a new blog with a focus on tech and business.

Note: To generate an RSS feed the YAML date must include the offset from Coordinated Universal Time (UTC). In the example above, the offset is -0400.

Template tags

Blog RSS XML page

Blog index page: a list of articles

All other pages

Configuration file

A JSON or YAML configuration file is optional:

Name Usage
BUILD_DIR Directory to store built HTML files. Default: ‘build’.
DISPLAY_DATE_FORMAT HTML date format. Default: ‘%d %b %Y’.
SOURCE_DATE_FORMAT Markdown date format. Default: ‘%Y-%m-%d %H:%M %z’.
RSS_ARTICLE_COUNT Number of blog articles in the RSS feed. Default: 50.
RSS_DATE_FORMAT RSS feed date format (must conform to RFC 822). Default: ‘%a %d %b %Y %H:%M %Z’.

License

MIT License.

Contact me

Send bug reports and patches to craig@seagrape.us.