-
Notifications
You must be signed in to change notification settings - Fork 1
/
pelicanconf.py
145 lines (110 loc) · 3.63 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
from datetime import date
# Site metadata
SITENAME = "Knowledge Bits"
SITESUBTITLE = "References I wish I'd already found"
AUTHOR = "John T. Wodder II"
DEFAULT_LANG = "en"
TIMEZONE = "America/New_York"
LOCALE = "en_US.UTF-8"
# Site input layout
PATH = "src"
ARTICLE_PATHS = ["posts"]
STATIC_PATHS = ["static"]
IGNORE_FILES = [".*.swp"]
USE_FOLDER_AS_CATEGORY = False
# Site output layout
OUTPUT_PATH = "build"
ARTICLE_URL = "posts/{slug}/"
ARTICLE_SAVE_AS = ARTICLE_URL + "index.html"
ARTICLE_LANG_URL = "posts/{slug}/{lang}/"
ARTICLE_LANG_SAVE_AS = ARTICLE_LANG_URL + "index.html"
ARCHIVES_SAVE_AS = "posts/index.html"
DRAFT_URL = "drafts/{slug}/"
DRAFT_SAVE_AS = DRAFT_URL + "index.html"
DRAFT_LANG_URL = "drafts/{slug}/{lang}/"
DRAFT_LANG_SAVE_AS = DRAFT_LANG_URL + "index.html"
PAGE_URL = "{slug}/"
PAGE_SAVE_AS = PAGE_URL + "index.html"
PAGE_LANG_URL = "{slug}/{lang}/"
PAGE_LANG_SAVE_AS = PAGE_LANG_URL + "index.html"
DRAFT_PAGE_URL = "drafts/{slug}/"
DRAFT_PAGE_SAVE_AS = DRAFT_PAGE_URL + "index.html"
DRAFT_PAGE_LANG_URL = "drafts/{slug}/{lang}/"
DRAFT_PAGE_LANG_SAVE_AS = DRAFT_PAGE_LANG_URL + "index.html"
AUTHOR_URL = 'authors/{slug}/'
AUTHOR_SAVE_AS = AUTHOR_URL + 'index.html'
AUTHORS_SAVE_AS = 'authors/index.html'
CATEGORY_URL = "categories/{slug}/"
CATEGORY_SAVE_AS = CATEGORY_URL + "index.html"
CATEGORIES_SAVE_AS = "categories/index.html"
TAG_URL = "tags/{slug}/"
TAG_SAVE_AS = TAG_URL + "index.html"
TAGS_SAVE_AS = "tags/index.html"
DEFAULT_PAGINATION = 20
PAGINATION_PATTERNS = [
(1, "{url}", "{save_as}"),
(2, "{base_name}/{number}/", "{base_name}/{number}/index.html"),
]
# Building & formatting settings
CACHE_CONTENT = False
STATIC_CHECK_IF_MODIFIED = True
DOCUTILS_SETTINGS = {
"compact_lists": False,
"field_name_limit": 0,
"smart_quotes": True,
"strip_comments": True,
"math_output": "mathjax irrelevant.value",
"toc_backlinks": "top",
}
SLUGIFY_SOURCE = "basename"
PAGE_ORDER_BY = "title"
DEFAULT_CATEGORY = "Miscellanea"
DEFAULT_DATE_FORMAT = "%Y-%m-%d"
# Plugins
PLUGINS = ["plugins.autopages"]
# autopages
AUTHOR_PAGE_PATH = f"{PATH}/authors"
CATEGORY_PAGE_PATH = f"{PATH}/categories"
TAG_PAGE_PATH = f"{PATH}/tags"
# Themes
THEME = "./theme"
# Theme variables
USE_MATHJAX = True
GITHUB_SOURCE_URL = "https://github.com/jwodder/kbits"
PATH_IN_REPO = PATH # PATH relative to root of repository
SHOW_AUTHOR = True
SHOW_AUTHOR_IN_LISTINGS = False
author_footer_link = "https://github.com/jwodder"
site_creation_year = 2020
this_year = date.today().year
if this_year == site_creation_year:
copyright_years = site_creation_year
else:
copyright_years = f"{site_creation_year}–{this_year}"
FOOTER_HTML = f"""
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/">
<img alt="Creative Commons License" style="border-width: 0; vertical-align: middle;" src="https://i.creativecommons.org/l/by/4.0/80x15.png" />
</a>
Copyright © {copyright_years} <a xmlns:cc="http://creativecommons.org/ns#"
href="{author_footer_link}" property="cc:attributionName"
rel="cc:attributionURL">{AUTHOR}</a>. This site's content is licensed under a
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative
Commons Attribution 4.0 International License</a>.
"""
DISPLAY_CATEGORIES_ON_MENU = False
DISPLAY_PAGES_ON_MENU = False
MENUITEMS = [
("About This Site", "about/"),
("Categories", "categories/"),
("Tags", "tags/"),
("Site Repository", "https://github.com/jwodder/kbits"),
]
# Variables to leave unset during development:
SITEURL = ""
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = None
TRANSLATION_FEED_ATOM = None
AUTHOR_FEED_ATOM = None
AUTHOR_FEED_RSS = None
# Other
BIND = "127.0.0.1"