Skip to content

Instantly share code, notes, and snippets.

@johnmathews
Created January 7, 2021 11:39
Show Gist options
  • Save johnmathews/703ac149ba3bf4e53290514bbec7d561 to your computer and use it in GitHub Desktop.
Save johnmathews/703ac149ba3bf4e53290514bbec7d561 to your computer and use it in GitHub Desktop.
my pelican settings file
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from pelican_jupyter import markup as nb_markup
# SITE META
AUTHOR = 'John Mathews'
SITENAME = 'JohnMathews.eu'
PATH = 'content'
TIMEZONE = 'Europe/Amsterdam'
DEFAULT_LANG = 'en'
THEME = 'themes/custom/'
DEFAULT_DATE_FORMAT = '%-d %B'
DEFAULT_METADATA = {
'summary': '',
}
# articles with dates in the future are drafts (not published yet)
WITH_FUTURE_DATES = True
# LOCAL ONLY
RELATIVE_URLS = True
DRAFT_SAVE_AS = 'drafts/{slug}.html'
DRAFT_URL = 'drafts/{slug}.html'
# SITE SETTINGS
INDEX_URL = 'blog'
INDEX_SAVE_AS = f'{INDEX_URL}.html'
MARKDOWN = {
'extension_configs': {
'markdown.extensions.codehilite': {'css_class': 'highlight'},
'markdown.extensions.extra': {},
'markdown.extensions.meta': {},
'markdown.extensions.toc': {},
},
'output_format': 'html5',
}
# https://docs.getpelican.com/en/4.5.3/tips.html?highlight=extra#copy-static-files-to-the-root-of-your-site
STATIC_PATHS = [
'documents',
'images',
'extra/CNAME',
'extra/robots.txt',
'extra/favicon.png',
]
EXTRA_PATH_METADATA = {
'extra/robots.txt': {'path': 'robots.txt'},
'extra/CNAME': {'path': 'CNAME'},
'extra/favicon': {'path': 'favicon.png'},
}
DELETE_OUTPUT_DIRECTORY = True
OUTPUT_RETENTION = ['.git', '.gitignore', 'CNAME']
DEFAULT_PAGINATION = None
LOAD_CONTENT_CACHE = False
TYPOGRIFY = True
SITEMAP = {
"format": "xml",
"priorities": {
"articles": 0.5,
"indexes": 0.5,
"pages": 0.5
},
"changefreqs": {
"articles": "monthly",
"indexes": "daily",
"pages": "monthly"
}
}
# FEEDS
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = None
TRANSLATION_FEED_ATOM = None
AUTHOR_FEED_ATOM = None
AUTHOR_FEED_RSS = None
# THEME
USE_CATEGORIES = False # chronological
# PAGES
PAGE_URL = PAGE_SAVE_AS = '{slug}.html'
# ARTICLES
PLUGINS = [
nb_markup,
'neighbors',
'plican.plugins.render_math',
'pelican.plugins.sitemap',
'pelican.plugins.simple_footnotes',
'pelican.plugins.more_categories',
]
IPYNB_SKIP_CSS = True
IGNORE_FILES = [
'.ipynb_checkpoints',
'*.ipynb',
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment