It’s Working

I struggled for several hours over this, so thought I’d make some notes. I’m using Pelican to generate the website as a static set of pages. However, getting the file structure to work correctly was not so clear, and I’ve just figured out where one of the directory names comes from. So, it seems to be working as I think it should. Here’s the relevant code in pelicanconf.py:

set up site structure (input, output)

PAGINATION_PATTERNS = (
     (1, '{base_name}/', '{base_name}/index.html'),
     (2, '{base_name}/page/{number}/', '{base_name}/page/{number}/index.html'),
 )

PATH = 'content'
DISPLAY_PAGES_ON_MENU = "True"
DEFAULT_CATEGORY = ['pages']

STATIC_PATHS = ['static', 'images']

PAGE_PATHS = ['pages']
PAGE_EXCLUDE = ['static', 'articles']
PAGE_URL = 'pages/{slug}/'
PAGE_SAVE_AS = PAGE_URL + 'index.html'
PAGE_LANG_SAVE_AS = False

ARTICLE_PATHS = ['articles']
ARTICLE_EXCLUDES = ['pages', 'static']
ARTICLE_URL = 'article/{date:%Y}/{slug}/'
ARTICLE_SAVE_AS = ARTICLE_URL + 'index.html'

#
# The category name/directory comes from the Category: Blog (or other) in the markdown header. 
CATEGORY_URL = '{slug}/'
CATEGORY_SAVE_AS = CATEGORY_URL + 'index.html'

TAG_URL = 'tag/{slug}/'
TAG_SAVE_AS = TAG_URL + 'index.html'

TAGS_URL = ('tags/')
TAGS_SAVE_AS = None

Ok, that really wasn’t so hard after all, but it wasn’t so obvious from the documentation either.

On to more important things…

links