A theme for the Pelican (a static site generator)

A theme for the Pelican (a static site generator)

About

A theme for the Pelican (a static site generator).

It's based on the tuxlite_tbs theme but was significantly rewritten and extended by new features and customization.

Features

  • Most of interface blocks such as a menu and a side bar, including their elements, can be turned on and off
  • An archives index with links to years and months
  • Lists of categories, tags, authors and pages with an elements' description as separate pages
  • Lists of pages on a side bar
  • Configurable start page (what page to show if access the site's root)
  • A compact paginator for the unlimited number of pages
  • Provided configuration hides all html files in the end of links. All URLs end with a slash (e.g. site/path/to/)
  • Any sub-directories along the path of URLs are accessable (e.g. site/tag/misc/ , site/tag/ , site/)
  • A year in a copyright notice (How to Write a Copyright Notice) is set dynamically and it depends on an entity:
    • on group pages (tags, articles) it's set to dates of a first and a last articles
    • on a single page or article it's set to a creation date
  • Versioning of static assets from the config file
  • Configurable header tags (meta) for SEO and a separate template for a favicon
  • Shows avarage time to read an article
  • Bonus:
    • a template of content directory and examples of configuration files for a tyical site
    • a simplified version of a Makefile (requires adjusting only a few path variables in a header) with a few features:
      • bundle CSS and JS files
      • build sites using dockerized Pelican
      • serve sites using dockerized Nginx
      • fallback to local/virtualenv Pelican with an integrated web server
      • one-liner to publish a site to a docs to the GitHub Pages in the same branch

Installation

The installation process is fairly trivial. Basically, you need only the theme directory from this repo. A path to it can be set in a few ways:

  • in the THEMEDIR variable of the provided Makefile
  • in the -t /path/to/theme/ command line option of pelican
  • in the THEME variable of pelicanconf.py

This theme relies on a bunch of variables which are set in specific values. So, in addition, you need to adjust a configuration of your site accordingly to provided example files pelicanconf.py.example and publishconf.py.example.

Examples

The example of a site's configuration with articles, pages, sitemap, robots.txt, favicon.ico, etc which is assumed to be used in GitHub Pages is presented in the separate branch.

Another examples of using this theme in live are

A few words about index.html

A list of articles is commonly placed in the root of the site in index.html. In this case, you cannot choose another start point, for example, some landing page. That's why I added a START_URL variale that specifies the URL to where a client will be redirected automatically from the root of the site. This is done by a simple start.html template. The original list of articles is intended to be placed in news/index.html. Check TEMPLATE_PAGES and INDEX_SAVE_AS variables in the example configuration for details.

Screenshots

The main landing page with news

An example of an article page

An archive index page

An exmle of how Author's index looks like on tablets

The main landing page on a common mobile device