schmittlau.ch-pelican/pelicanconf.py

141 lines
4.2 KiB
Python
Raw Normal View History

#!/usr/bin/env python3
2022-02-28 14:13:56 +01:00
# -*- coding: utf-8 -*- #
from datetime import datetime
2022-02-28 14:13:56 +01:00
AUTHOR = 'Trolli Schmittlauch'
SITENAME = 'Schmittlauchs Blog & Homepage'
SITETITLE = 'schmittlauch'
SITESUBTITLE = 'Das Leben ist eine Abschweifung.'
SITEURL = 'http://127.0.0.1:8000'
SITELOGO = '/images/avatar.png'
FAVICON = '/images/favicon.svg'
2022-02-28 14:13:56 +01:00
PATH = 'content'
STATIC_PATHS = ['images', 'static']
ARTICLE_PATHS = ['blog']
INDEX_SAVE_AS = 'blog/index.html'
ARTICLE_URL = 'blog/{slug}.html'
ARTICLE_SAVE_AS = 'blog/{slug}.html'
CUSTOM_CSS = "static/custom.css"
# enable typography pre-processing for nicer appearance
TYPOGRIFY = True
2022-02-28 14:13:56 +01:00
TIMEZONE = 'Europe/Berlin'
# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = None
TRANSLATION_FEED_ATOM = None
AUTHOR_FEED_ATOM = None
AUTHOR_FEED_RSS = None
DISPLAY_PAGES_ON_MENU = False
DISPLAY_CATEGORIES_ON_MENU = False
MAIN_MENU = True
MENUITEMS = (
("Blog", "/blog/"),
("Archives", "/archives.html"),
("Categories", "/categories.html"),
("Tags", "/tags.html"),
("Impressum", "/pages/impressum.html"),
("Seitenquelltext", "https://git.orlives.de/schmittlauch/schmittlau.ch-pelican/"),
)
# lefthand menu
LINKS = (('Blog', '/blog/'),
('Über mich', '/pages/about.html'),
('Berufliches & Lebenslauf', '/pages/professional.html'),
('Kontakt', '/pages/contact.html'),
#('', ''),
)
2022-02-28 14:13:56 +01:00
# Social widget
SOCIAL = (
("mastodon", "https://toot.matereal.eu/@schmittlauch"),
("twitter", "https://twitter.com/schmittlauch"),
#("matrixdotorg", ""),
2022-03-02 03:00:18 +01:00
("envelope", "mailto:t.schmittlauch+blog@orlives.de"),
("git", "https://git.orlives.de/schmittlauch/"),
("github", "https://github.com/schmittlauch/"),
("rss", f"/feeds/all.atom.xml"),
)
2022-02-28 14:13:56 +01:00
DEFAULT_PAGINATION = 10
# Uncomment following line if you want document-relative URLs when developing
#RELATIVE_URLS = True
2022-02-28 17:13:02 +01:00
# Multilang
MARKDOWN = {
'extension_configs': {
'markdown.extensions.codehilite': {'use_pygments': True},
'markdown.extensions.fenced_code': {},
'markdown.extensions.footnotes': {},
'markdown.extensions.tables': {},
'markdown.extensions.attr_list': {},
},
'output_format': 'html5',
}
DEFAULT_LANG = 'de'
OG_LOCALE = "de_DE"
LOCALE = ("de_DE", "de_DE.utf8")
2022-02-28 14:13:56 +01:00
PLUGIN_PATHS = ['pelican-plugins']
PLUGINS = ['i18n_subsites']
# Enable Jinja2 i18n extension used to parse translations.
JINJA_ENVIRONMENT = {'extensions': ['jinja2.ext.i18n']}
# Default theme language.
I18N_TEMPLATES_LANG = "en"
2022-02-28 14:13:56 +01:00
I18N_SUBSITES = {
(_LOC := 'en'): {
'OG_LOCALE': "en",
'LOCALE': ("en_GB", "en_GB.utf8"),
# override default and remove untranslated articles
'I18N_UNTRANSLATED_ARTICLES': 'remove',
# translation of strings, menu, titles
2022-03-01 02:16:32 +01:00
'SITENAME': "Schmittlauch's Blog & Homepage",
'SITESUBTITLE': 'Life is a digression.',
'MENUITEMS': (
("Blog", f"/{_LOC}/blog/"),
("Archives", f"/{_LOC}/archives.html"),
("Categories", f"/{_LOC}/categories.html"),
("Tags", f"/{_LOC}/tags.html"),
2022-03-02 18:03:48 +01:00
("Legal", f"/{_LOC}/pages/impressum.html"),
("Page Source", "https://git.orlives.de/schmittlauch/schmittlau.ch-pelican/"),
),
'LINKS': (
('Blog', f'/{_LOC}/blog/'),
('About', f'/{_LOC}/pages/about.html'),
('Professional & CV', f'/{_LOC}/pages/professional.html'),
('Contact', f'/{_LOC}/pages/contact.html'),
#('', ''),
),
2022-02-28 14:13:56 +01:00
}
}
# idea: almost everyone understanding also understands English,
# so keep English-only posts in the German page
I18N_UNTRANSLATED_ARTICLES = 'keep'
2022-02-28 17:13:02 +01:00
# Theming, templates, and specific configs
2022-02-28 17:13:02 +01:00
THEME = './theme/Flex'
THEME_COLOR_AUTO_DETECT_BROWSER_PREFERENCE = True
THEME_COLOR_ENABLE_USER_OVERRIDE = True
CC_LICENSE = {
"name": "Creative Commons Attribution-ShareAlike",
"version": "4.0",
"slug": "by-sa",
2022-03-01 02:15:38 +01:00
"local_icons": True,
}
COPYRIGHT_YEAR = datetime.now().year
DISABLE_URL_HASH = True
USE_GOOGLE_FONTS = False