Pelican¶
Creating a New Site¶
Create a directory for the project, and a virtualenv.
Inside the virtualenv, or using an appropriate package manager…
pip install pelican[Markdown]
Run pelican-quickstart inside the project directory to set up a skeleton site.
Ready to customise!
Creating Content¶
Content generally goes in the content directory, articles in the root and pages in content/pages. There is a setting to use directories as categories though. I put images related to the content in content/images, usually in sub-directories for individual articles.
Metadata¶
Example:
Title: Devs
Date: 2020-04-24 13:03
Modified: 2020-04-24 13:03
Category: TV
Tags: sci-fi, religion
Slug: devs
Authors: Kevin Houlihan
Summary: Beautiful, and perhaps appropriately predictable.
Status: draft
There is also Template, if an article or page needs a special template for some reason.
Status can be draft, published or hidden.
Development and Deploy Commands¶
There are several ways to build the project, but the easiest is probably to use Make
Local devserver:
make devserver
Publish:
make publish
Clean the output:
make clean
Built content goes into a directory called output, the contents of which can be deployed wherever.
If poetry is used for a project (which it really should be), the make commands do not work. Instead, to run a devserver:
poetry run pelican --autoreload --listen