Pelican

Pelican is a static site generator built in Python. It manages a templates directory and a content directory, and the content is converted to site files (HTML) conforming to the available templates.

Usage

  • pelican content: build site from files in content/ to output/ folder
  • pelican --listen: serve generate files on port 8000 (by default)
  • pelican content -t themes/theme: build site using theme at specified location

File Format

  • Content files can be written in Markdown (preferred by me) or ReStructured Text.

Templating

  • All templates will receive the upper case variables in the Pelican settings file. They can referenced directly using Jinja: {{ var }}

Content

Content is stored in the content/ directory. This includes raw Markdown post files, static content (like post images), static pages, etc.

Static Content

Static content can be stored in the content directory however you’d like. However, Pelican will only copy over those static content folders to output that are explicitly listed in the STATIC_PATHS setting variable. These listed folders will be copied over regardless of whether or not posts reference them. Content referenced by posts, however, regardless of location will be included in the output directory.

Pages

Pages are rendered directly with Jinja2, treated similarly to how they were processed with the previous Flask site. The pages to be processed directly have to be listed in the TEMPLATE_PAGES settings variable. For now, these template pages are to be mixed with standard Markdown pages, all placed in the content/pages directory. This the cleanest and most canonical location for placing them. There is not much of a difference between standard markdown pages and articles in Pelican; they are separated primarily due to their semantic differences, where articles are typically associated with a date on a blog and pages are not temporal in nature and do not change frequently.

Pelican internals

Great source on Pelican internal