-
Notifications
You must be signed in to change notification settings - Fork 0
/
pelicanconf.py
327 lines (284 loc) · 9.97 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from datetime import date
from minchin.pelican.plugins import autoloader
AUTHOR = "Wm. Minchin"
SITENAME = "Minchin.ca"
SITEURL = ""
SITE_ROOT_URL = "https://minchin.ca"
TIMEZONE = "America/Edmonton"
DEFAULT_LANG = "en"
# Caching
# CACHE_CONTENT = True
# LOAD_CONTENT_CACHE = True
# Blogroll
# LINKS = (('Pelican', 'http://getpelican.com/'),
# ('Python.org', 'http://python.org/'),
# ('Jinja2', 'http://jinja.pocoo.org/'),
# ('You can modify those links in your config file', '#'),)
# Social widget
# SOCIAL = (('You can add links in your config file', '#'),
# ('Another social link', '#'),)
DEFAULT_PAGINATION = 10
# USE_PAGER = False
PAGINATOR_LIMIT = 6
# static paths will be copied under the same name
# these are relative to the base CONTENT folder
STATIC_PATHS = [
"images",
"../extras",
# "css",
# "design",
# "js",
# "fonts",
# "pages/img",
"../.gitattributes",
"../.gitignore",
# "../README.txt",
]
# STATIC_EXCLUDE = ['theme/less']
# A list of files to copy from the source to the destination
EXTRA_PATH_METADATA = {
"../.gitattributes": {"path": ".gitattributes"},
"../.gitignore": {"path": ".gitignore"},
"../README.txt": {"path": "README.txt"},
"../extras/minchin.ico": {"path": "favicon.ico"},
}
# Custom settings
# FILENAME_METADATA = ('(?P<date>\d{4}-\d{2}-\d{2}).*') # default?
# FILENAME_METADATA = '(?P<date>\d{4}-\d{2}-\d{2})_(?P<slug>.*)' # extract date and slug
# FILENAME_METADATA = '(?P<slug>[\w-]*)' # so anything before the file extension becomes the slug
FILENAME_METADATA = r"(?P<date>\d{4}\d{2}\d{2})-(?P<slug>.*)"
## Please note that the metadata available inside your files takes precedence
# over the metadata extracted from the filename.
MARKUP = ("rst", "md", "markdown", "mkd", "mdown", "html", "htm")
PATH = "content"
# OUTPUT_PATH = '../blog.minchin.ca-temp/' # default is 'output/'
# FORMATTED_FIELDS = [
# # "summary",
# # "title",
# "subtitle",
# ]
# Set URL's
TAG_URL = "label/{slug}/"
TAG_SAVE_AS = "label/{slug}/index.html"
TAGS_URL = "label/"
TAGS_SAVE_AS = "label/index.html"
CATEGORY_URL = "category/{slug}/"
CATEGORY_SAVE_AS = "category/{slug}/index.html"
CATEGORIES_URL = "category/"
CATEGORIES_SAVE_AS = "category/index.html"
ARTICLE_URL = "{date:%Y}/{date:%m}/{slug}.html"
ARTICLE_SAVE_AS = ARTICLE_URL
AUTHORS_URL = ""
AUTHORS_SAVE_AS = ""
ARCHIVES_URL = "archives/"
ARCHIVES_SAVE_AS = "archives/index.html"
YEAR_ARCHIVE_URL = "{date:%Y}/"
YEAR_ARCHIVE_SAVE_AS = "{date:%Y}/index.html"
MONTH_ARCHIVE_URL = "{date:%Y}/{date:%m}/"
MONTH_ARCHIVE_SAVE_AS = "{date:%Y}/{date:%m}/index.html"
PAGE_URL = "{slug}.html"
PAGE_SAVE_AS = PAGE_URL
# Add Blog to sidebar
MENUITEMS = (
("Blog", SITEURL + "/", "fa fa-fw fa-pencil"),
("Genealogy", "https://genealogy.minchin.ca/", "glyphicon glyphicon-tree-deciduous"),
("My Projects", "http://minchin.ca/projects/", "fa fa-fw fa-flask"),
("Search", "http://minchin.ca/search/", "fa fa-fw fa-search"),
("About", "http://minchin.ca/about/", "fa fa-fw fa-info-circle"),
("Contact Me", "http://minchin.ca/contact/", "fa fa-fw fa-envelope"),
)
MENUITEMS_2_AT = "Blog"
MENUITEMS_2_AT_LINK = "" # this is added to SITEURL
MENUITEMS_2 = (
# ('Archives', SITEURL + '/' + ARCHIVES_URL, 'fa fa-fw fa-archive'),
("Labels", SITEURL + "/" + TAGS_URL, "fa fa-fw fa-tags"),
)
DISPLAY_PAGES_ON_MENU = False
# # see http://www.voidynullness.net/blog/2015/06/25/add-recent-posts-list-to-pelican-blog/
# TEMPLATE_PAGES = {
# "404.html": "404.html",
# }
# Theme Related
SEAFOAM_DEV_MODE = True
OPTIMIZE_IMAGES_DEV_MODE = True
TYPOGRIFY = True
# THEME = seafoam.get_path() # auto added by Seafoam
SITELOGO = "images/MinchindotCA-200.png"
SITELOGO_SIZE = "100%"
PYGMENTS_STYLE = "friendly"
DISPLAY_BREADCRUMBS = True
FAVICON = "favicon.ico"
# BOOTSTRAP_THEME = "seafoam" # auto added by Seafoam
USE_OPEN_GRAPH = True
# CUSTOM_CSS = 'css/minchin-ca.css'
DOCUTIL_CSS = False
CUSTOM_JS_LIST = []
# update copyright date automatically
INDEX_COPY_DATE = "2006-{}".format(str(date.today().year)[-2:])
TAGS_TEXT = "Labels"
# list categories here in lowercase
CATEGORY_IMAGES = {
"colourettu": "images/2015/colourettu-logo-4x.png",
"seafoam": "images/2017/seafoam-logo-4x.png",
"minchin-dot-ca-theme": "images/2016/minchindotca-theme-article.png",
"pelican-plugins": "images/2020/pelican_logo.png",
"covid": "images/2020/coronavirus-cdc-645x645.jpg",
}
# Plugins
PLUGIN_PATHS = ("../pelican-plugins",)
AUTOLOADER_NAMESPACES = autoloader.DEFAULT_NAMESPACE_LIST + [
"pelican.plugins",
]
# if not autoloader.pelican_namespace_plugin_support():
# PLUGINS = [
# autoloader,
# ]
# else:
# PLUGINS = []
#
# PLUGINS = PLUGINS + [
PLUGINS = [
autoloader,
"pelican_alias",
]
# PLUGINS = [
# "pelican.plugins.seafoam",
# # "assets", # unused
# "pelican_alias",
# "pelican_comment_system", # see https://github.com/Scheirle/pelican_comment_system/issues/9
# "pelican.plugins.neighbors",
# # "pelican.plugins.image_process", # publish only # auto added by Seafoam
# # "minchin.pelican.plugins.cname", # publish only
# # "minchin.pelican.plugins.nojekyll", # publish only
# # "pelican.plugins.jinja_filters", # auto added by Seafoam
# "minchin.pelican.plugins.summary",
# # "minify", # publish only
# # "extended_sitemap", # publish only
# # "optimize_images", # publish only
# "minchin.pelican.plugins.post_stats",
# ]
ASSET_CSS = False
ASSET_JS = False
NEIGHBORS = True
PELICAN_COMMENT_SYSTEM = True
PELICAN_COMMENT_SYSTEM_IDENTICON_DATA = ("author", "email")
PELICAN_COMMENT_SYSTEM_EMAIL_USER = "minchinweb"
PELICAN_COMMENT_SYSTEM_EMAIL_DOMAIN = "gmail.com"
PELICAN_COMMENT_SYSTEM_AUTHORS = {
("PROTIK KHAN", "[email protected]"): "images/authors/rabiul_karim.webp",
("Matthew Hartzell", "[email protected]"): "images/authors/matthew_hartzell.webp",
("Jens-Peter Labus", "[email protected]"): "images/authors/jens-peter_labus.png",
("Bridget", "[email protected]"): "images/authors/bridget.jpg",
("melissaclee", "[email protected]"): "images/authors/melissa_lee.jpg",
("Melissa", "[email protected]"): "images/authors/melissa_lee.jpg",
}
IMAGE_PROCESS = {
"example-pict": {
"type": "picture",
"sources": [
{
"name": "default",
"media": "(min-width: 640px)",
"srcset": [
("640w", ["scale_in 640 480 True"]),
("1024w", ["scale_in 1024 683 True"]),
("1600w", ["scale_in 1600 1200 True"]),
],
"sizes": "100vw",
},
{
"name": "source-1",
"srcset": [
("1x", ["crop 100 100 200 200"]),
("2x", ["crop 100 100 300 300"]),
],
},
],
"default": ("default", "640w"),
},
"col-9": {
"type": "picture",
"sources": [
{
"name": "default",
"srcset": [
(
"768w",
["scale_in 750 562.5 True"],
), # actually 12 cols (full width) on smallest screens
("992w", ["scale_in 727.5 545.5 True"]),
("1200w", ["scale_in 877.5 658 True"]),
],
"sizes": "100vw",
},
],
"default": ("default", "1200w"),
},
"index-thumbnail": {
"type": "picture",
"sources": [
{
"name": "default",
"srcset": [
(
"768w",
["scale_in 187.5 140.5 True"],
), # actually 12 cols (full width) on smallest screens
# 157.5
("992w", ["scale_in 212.5 182 True"]),
("1200w", ["scale_in 262.5 219.5 True"]),
],
"sizes": "100vw",
},
],
"default": ("default", "1200w"),
},
}
IMAGE_PROCESS_PARSER = SEAFOAM_PARSER = "html5lib"
# IMAGE_PROCESS_FORCE = True # force reproduction of all images
# SUMMARY_BEGIN_MARKER = '<!-- PELICAN_BEGIN_SUMMARY -->'
# SUMMARY_END_MARKER = '<!-- PELICAN_END_SUMMARY -->'
SUMMARY_USE_FIRST_PARAGRAPH = True
SUMMARY_END_MARKER = "<!-- read more -->"
# `assets` sounds good, but I can't figure out how to get it to work for my CSS
# `better_figures_and_images` didn't seem to do what I wanted (see Projects)
# `gallery` looks good, but don't have a use here yet
# `liquid_tags` & `pelican_comment_system` might be useful...
# `optimize_images` works, but I don't have many images yet
# - requires `jpegtran.exe` <http://jpegclub.org/jpegtran/> and
# `optinpng.exe` <http://sourceforge.net/projects/optipng/>
# look into 'neighbors' plugin for profiles
# # Make things disappear
DISPLAY_CATEGORIES_ON_MENU = False
HIDE_SITENAME = True
HIDE_SIDEBAR = True
GITHUB_USER = False
ADDTHIS_PROFILE = False
DISQUS_SITENAME = False
PDF_PROCESSOR = False
# Feed generation is usually not desired when developing
FEED_DOMAIN = SITEURL
# FEED_ATOM = None
# FEED_ALL_ATOM = None
FEED_RSS = None
FEED_ALL_RSS = None
# CATEGORY_FEED_ATOM = None
# CATEGORY_FEED_RSS = None
# AUTHOR_FEED_ATOM = None
AUTHOR_FEED_ATOM = "feeds/author.{slug}.atom.xml"
# AUTHOR_FEED_RSS = None
TAG_FEED_ATOM = "feeds/label.{slug}.atom.xml" # not automatically generated
# TAG_FEED_RSS = None
TRANSLATION_FEED_ATOM = None
TRANSLATION_FEED_RSS = None
# FEED_MAX_ITEMS = 0
## Testing
# PATH = 'content-2'
# PLUGINS.append("minification") # currently eats too many spaces
# try pelican-diminuendo
# try pelican-minify / minify
# PLUGINS.append('pelican_diminuendo')
# DISPLAY_PAGES_ON_MENU = True
# add markdown extras, smart symbols -- https://facelessuser.github.io/pymdown-extensions/extensions/smartsymbols/