-
Notifications
You must be signed in to change notification settings - Fork 0
/
pelicanconf.py
127 lines (105 loc) · 3.77 KB
/
pelicanconf.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
""" Configuration file for DLTJ blog
"""
import os
import pelican.plugins.dltj_plugin as macros
AUTHOR = "Peter Murray"
SITENAME = "Disruptive Library Technology Jester"
SITEURL = "https://dltj.org"
DEFAULT_CATEGORY = "Meta Category"
PATH = "content"
STATIC_PATHS = ARTICLE_EXCLUDES = ["assets", "resume"]
ROOT_CONTENT = "root-content"
EXTRA_PATH_METADATA = {}
static_basedir = os.path.join(
os.path.dirname(os.path.abspath(__file__)), PATH + os.sep + ROOT_CONTENT + os.sep
)
for root, dirs, files in os.walk(static_basedir):
for file in files:
dst_path = os.path.relpath(os.path.join(root, file), static_basedir)
src_path = os.path.join(ROOT_CONTENT, dst_path)
STATIC_PATHS.append(src_path)
EXTRA_PATH_METADATA[src_path] = {"path": dst_path}
# Put articles in their own directory, see
# https://github.com/getpelican/pelican/discussions/3362#discussioncomment-9988666
FILENAME_METADATA = r"(?P<date>\d{4}-\d{2}-\d{2})-(?P<slug>.*)"
USE_FOLDER_AS_CATEGORY = False
ARTICLE_URL = "article/{slug}"
ARTICLE_SAVE_AS = "article/{slug}/index.html"
PAGE_URL = "{slug}"
PAGE_SAVE_AS = "{slug}/index.html"
# Top-level category and tag pages are at the index.html
# of a directory (rather than being as `categories.html` and
# `tags.html`)
CATEGORIES_URL = "category"
CATEGORIES_SAVE_AS = "category/index.html"
TAGS_URL = "tag"
TAGS_SAVE_AS = "tag/index.html"
# Actual category and tag pages are subdirectories under
# `category` and `tag` directories
CATEGORY_URL = "category/{slug}"
CATEGORY_SAVE_AS = "category/{slug}/index.html"
TAG_URL = "tag/{slug}"
TAG_SAVE_AS = "tag/{slug}/index.html"
TIMEZONE = "US/Eastern"
DEFAULT_LANG = "en"
THEME = "pelican-papyrus-theme"
PROFILE_IMAGE = "PMurray_2016_square_98x98.webp"
# These macros are available on all content pages
JINJA_GLOBALS = {
"image": macros.image,
"robustlink": macros.robustlink,
"note": macros.note,
"thursday_threads_header": macros.thursday_threads_header,
"thursday_threads_quote": macros.thursday_threads_quote,
"captioned": macros.captioned,
}
MARKDOWN = {
"extension_configs": {
"markdown.extensions.fenced_code": {},
"markdown.extensions.codehilite": {
"css_class": "highlight",
"linenos": True,
"linenospecial": 2,
},
"markdown.extensions.extra": {},
"markdown.extensions.meta": {},
"markdown.extensions.toc": {},
"markdown.extensions.attr_list": {},
},
"output_format": "html5",
}
# PLUGINS = ["jinja2content", "yaml_metadata"]
# PLUGINS = ["zygote_reader"]
# 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
# BIO
BIO = "Library technologist, open source advocate, striving to think globally while acting locally"
# Menu Items
MENUITEMS = (("Résumé / CV", "/resume"), ("Newsletter", "https://newsletter.dltj.org/"))
DISPLAY_PAGES_ON_MENU = True
# Blogroll
LINKS = (
# ("Pelican", "https://getpelican.com/"),
# ("Python.org", "https://www.python.org/"),
# ("Jinja2", "https://palletsprojects.com/p/jinja/"),
# ("You can modify those links in your config file", "#"),
)
# Social widget
FONT_ACADEMICONS = True
SOCIAL = (
("email", "[email protected]"),
("mastodon", "https://code4lib.social/@dltj"),
("bluesky", "https://bsky.app/profile/dltj.org"),
# ("pgp", "https://keyoxide.org/hkp/2DA08D6069D2483DE5E537F348E5203C304F1344"),
("github", "https://github.com/dltj"),
("linkedin", "https://www.linkedin.com/in/DataGazetteer"),
("orcid", "https://orcid.org/0000-0003-4284-508X"),
)
DEFAULT_PAGINATION = 20
# Uncomment following line if you want document-relative URLs when developing
RELATIVE_URLS = True
LOAD_CONTENT_CACHE = False