How do I use pelican to set up a static site? https://pages.charlesreid1.com/how-do-i-pelican
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1.8 KiB

Configuring Your Pelican Site

The pelicanconf.py file contains all configuration variables that Pelican sites need to set.

Some of the configuration variables are common to all Pelican sites, others are particular to the theme you are using.

Here's an example configuration file from magic-flying-pelican:

pelicanconf.py:

import markdown

AUTHOR = u'charlesreid1'
SITENAME = u'ginsberg bot flock'
SITEURL = ''
PATH = 'content'
TIMEZONE = 'America/Los_Angeles'
DEFAULT_LANG = u'en'

# --------------8<---------------------
# Theme

THEME = 'simple-bootstrap'
# https://github.com/getpelican/pelican-themes/tree/master/simple-bootstrap


# --------------8<---------------------
# Files and content


# This will look for a directory img/ 
# inside the directory content/
# The contents of img/ will be available at 
# {{ SITEURL }}/img
STATIC_PATHS = ['img']

# If we want to create static pages,
# we should put them in content/pages
PAGE_PATHS = ['pages']

# If we want to create blog posts (articles),
# we should put them in content/posts
ARTICLE_PATHS = ['posts']


# --------------8<---------------------
# idk just some dumb stuff

DISPLAY_PAGES_ON_MENU = False
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = None
TRANSLATION_FEED_ATOM = None
AUTHOR_FEED_ATOM = None
AUTHOR_FEED_RSS = None
DEFAULT_PAGINATION = False

This will configure the content/ directory to contain a posts/ folder with blog posts and a pages/ folder with static pages.

There's a lot more that can be done with the configuration file, but much of it requires custom themes, so we'll leave it at that.

See the settings page of the pelican documentation for details.