~nprescott/quiescent

static site generator
b218cfd7 — Nolan Prescott 1 year, 8 months ago
Binary mode doesn't take an encoding!
4b360407 — Nolan Prescott 1 year, 8 months ago
Specify default encoding
ca41ac4f — Nolan Prescott 1 year, 10 months ago
Convert README, add CI config

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~nprescott/quiescent
read/write
git@git.sr.ht:~nprescott/quiescent

You can also use your local clone with git send-email.

#Quiescent

Simplified static site generation

Quiescent is a static site generator focused on eliminating complexity in creating weblog-like sites. It is built around the idea of static assets and plain-text, utilizing a hierarchical directory and URL structure for ease of use in hyperlinking and deploying to web-servers. All posts are written in Markdown, and later converted to plain HTML, there is support for publishing static assets such as images or JavaScript.

Quiescent does very little magic and aims only to simplify the annoying or boring parts of site creation, so that the focus remains on content. As such, the only parts of the resulting site that are automatically generated are the Atom feed, an index page, and an archive of all posts.

Quiescent uses Mistune for markdown parsing, and Python 3.

#Installation

pip install quiescent

#Usage

The interface to the program is through the quiescent command, which takes an optional argument -c or --config, to name a configuration .ini file other than the default config.ini.

cd blog-dir/
quiescent --bootstrap  # initial configuration
quiescent              # equivalent to quiescent --config config.ini

In order for the program to run as intended, the config.ini file must be modified to suit the destination site.

The following templates are required and included in the --bootstrap command upon initial configuration:

  • archive.html
  • index.html
  • post.html

#Templates

Quiescent implements its own code-generating template engine. The intent is for the majority of a template to be plain HTML, with a small number of points for data (usually written post information) to be "injected". The syntax is summarized below, more examples are available in the sample templates provided by the --bootstrap command:

{{variable_name}}

{{object.attribute}}

{% for item in iterable %}
{{item}}
{% endfor %}

{% if some_test %}
this text is conditional
{% endif %}

#Tips for Writing

All posts written require a title and a date using a specific format at the beginning of the markdown file. The format is as follows:

title: <post title>
date: <must match the date format in config.ini>
+++

An important note to keep in mind when writing posts, the links used in referencing local media (images, style sheets, etc.) are used directly in the Atom feed, which may break relative URLs. A solution to this (and the author's recommendation) is to specify a base URL and link relative to that, so that links resolve correctly throughout the generated content of the site.

#Publishing

Due to the design of quiescent, the contents and directory output from the generation process is suitable for any basic web-server capable of serving static files. In the case of the project author, after the site is built, simply rsync-ing the entire build directory is sufficient, for example:

cd build
rsync -avz . user@example.com:/static/file/directory

#Direction

Because of the wide variety of static site generators available this project has a specific focus, with no plans to implement the following:

  • a local web-server
  • multiple input formats
  • comments
  • cross-post-to-twitter
  • tags

#Development, Testing

The project contains some unittests which are runnable using the setup.py command and require no additional dependencies or configuration.

$ python setup.py -q test
....................................
----------------------------------------------------------------------
Ran 36 tests in 0.012s

OK

#License

GPLv3, see COPYING for more information