-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathpelicanconf.py
More file actions
198 lines (164 loc) · 5.48 KB
/
Copy pathpelicanconf.py
File metadata and controls
198 lines (164 loc) · 5.48 KB
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
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
from typing import Any
RELATIVE_URLS = False
_DEFAULT_LANGUAGE = "en"
PATH = "content"
AUTHOR = "Jack McKew"
SITENAME = "Jack McKew's Blog"
SITETITLE = SITENAME
SITESUBTITLE = "Engineer | Software Developer | Data Scientist"
SITEURL = "https://jackmckew.dev"
# SITEURL = "https://jackmckew.github.io/jackmckew.dev/"
# SITEURL = "http://localhost:8000"
IGNORE_FILES = ["*.html", "*.rst"]
DISPLAY_PAGES_ON_MENU = True
RELATED_POSTS_SKIP_SAME_CATEGORY = True
DISQUS_SITENAME = "jackmckew-dev"
GOOGLE_ANALYTICS = "UA-131173168-2"
# GOOGLE_ADSENSE_ID = 'ca-pub-1052275056735196'
# GOOGLE_ADSENSE = {
# 'ca_id': 'ca-pub-1052275056735196', # Your AdSense ID
# 'page_level_ads': True, # Allow Page Level Ads (mobile)
# 'ads': {
# 'aside': '1234561', # Side bar banner (all pages)
# 'main_menu': '1234562', # Banner before main menu (all pages)
# 'index_top': '1234563', # Banner after main menu (index only)
# 'index_bottom': '1234564', # Banner before footer (index only)
# 'article_top': '1234565', # Banner after article title (article only)
# 'article_bottom': '1234566', # Banner after article content (article only)
# }
# }
USE_TIPUE_SEARCH = True
# GITHUB_CORNER_URL = "https://github.com/JackMcKew/jackmckew.dev"
ARTICLE_URL = "{slug}.html"
# ARTICLE_SAVE_AS = 'posts/{date:%Y}/{date:%b}/{date:%d}/{slug}/index.html'
ARTICLE_SAVE_AS = "{slug}.html"
# YEAR_ARCHIVE_SAVE_AS = 'posts/{date:%Y}/index.html'
# MONTH_ARCHIVE_SAVE_AS = 'posts/{date:%Y}/{date:%b}/index.html'
# DAY_ARCHIVE_SAVE_AS = 'posts/{date:%Y}/{date:%b}/{date:%d}/index.html'
THEME = "./themes/Flex"
# STATIC_PATHS = ["content/img","static"]
STATIC_PATHS = ["img", "files", "html", "extra", "2018", "2019", "2020", "2021"]
# STATIC_SAVE_AS = "{dirname}"
EXTRA_PATH_METADATA = {
"extra/favicon.ico": {"path": "favicon.ico"},
"extra/jm-photo.jpg": {"path": "jm-photo.jpg"},
"extra/CNAME": {"path": "CNAME"},
"extra/ads.txt": {"path": "ads.txt"},
}
SITELOGO = "/jm-photo.jpg"
# EXTRA_PATH_METADATA = {
# 'img/favicon.ico' : {'path' : 'favicon.ico'}
# }
FAVICON = "/favicon.ico"
# CUSTOM_CSS = THEME + "static/custom.css"
USE_FOLDER_AS_CATEGORY = False
MAIN_MENU = True
HOME_HIDE_TAGS = False
MENUITEMS = (
# ("Authors", "/authors.html"),
("Archives", "/archives.html"),
("Categories", "/categories.html"),
("Tags", "/tags.html"),
("Sitemap", "/sitemap.xml"),
# ('RSS', "feeds/all.atom.xml")
# ("Search","/search.html")
)
NOTEBOOK_DIR = ""
CODE_DIR = ""
SITEMAP = {
"format": "xml",
"priorities": {"articles": 0.8, "indexes": 0.6, "pages": 0.7},
"changefreqs": {"articles": "weekly", "indexes": "daily", "pages": "monthly"},
}
PLUGIN_PATHS = [
"./plugins/",
# './plugins/pelican_javascript'
# './plugins/pelican_youtube'
]
# PLUGIN_PATHS = [
# "C:\\\\Users\\jackm\\.virtualenvs\\blog-mLKe2F5s\\Lib\\site-packages\\pelican\\pelican-plugins",
# "C:\\\\Users\\jackm\\.virtualenvs\\blog-mLKe2F5s\\Lib\\site-packages\\pelican\\pelican-plugins\\pelican_youtube",
# ]
DIRECT_TEMPLATES = ("index", "authors", "tags", "categories", "archives", "search")
PLUGINS = [
"sitemap",
# "better_codeblock_line_numbering",
"better_code_samples",
"bootstrapify",
"deadlinks",
"more_categories",
"neighbors",
# "pelican-ert",
"liquid_tags.notebook",
"liquid_tags.include_code",
"representative_image",
"share_post",
"show_source",
"tipue_search",
"dateish",
"post_stats",
"pelican_javascript",
"render_math",
"related_posts",
"autostatic",
"clean_summary",
]
CLEAN_SUMMARY_MAXIMUM = 1
# MARKUP = ('md', 'ipynb')
MARKUP = ("md",)
MARKDOWN = {
"extension_configs": {
"markdown.extensions.codehilite": {
"css_class": "highlight",
"linenums": "True",
},
"markdown.extensions.extra": {},
"markdown.extensions.meta": {},
"markdown.extensions.toc": {},
"markdown.extensions.tables": {},
},
"output_format": "html5",
}
# IPYNB_USE_METACELL = True
# IGNORE_FILES = [".ipynb_checkpoints"]
DELETE_OUTPUT_DIRECTORY = True
# ARTICLE_PATHS = ['blog']
# ARTICLE_SAVE_AS = '{date:%Y}/{slug}.html'
# ARTICLE_URL = '{date:%Y}/{slug}.html'
TIMEZONE = "Australia/Sydney"
DEFAULT_LANG = "English"
# Feed generation is usually not desired when developing
FEED_ALL_ATOM: Any = "feeds/all.atom.xml"
CATEGORY_FEED_ATOM: Any = "feeds/{slug}.atom.xml"
TRANSLATION_FEED_ATOM: Any = None
AUTHOR_FEED_ATOM: Any = None
AUTHOR_FEED_RSS: Any = None
FEED_MAX_ITEMS = 5
# Social widget
SOCIAL = (
("twitter", "https://twitter.com/Jac_McQ"),
("linkedin", "https://www.linkedin.com/in/jack-mckew/"),
("github", "https://github.com/JackMcKew"),
)
DEFAULT_PAGINATION = 10
# Uncomment following line if you want document-relative URLs when developing
# RELATIVE_URLS = True
import wordsum
# POST_TICKER = wordsum.count_files('./content',['.md','.ipynb'])
WORD_TICKER = wordsum.count_words("./content", [".md", ".ipynb"])
WORD_TICKER = f"{WORD_TICKER:,}"
import sys
sys.path.append(".")
import count_loc
custom_js_files = [
"content/2020/virus-outbreak-simulation/js/virus_part_1.js",
"content/2020/canvas-javascript-bouncing-balls/js/bouncing_balls.js",
]
language_stat = count_loc.get_total_loc(
"content", [".py", ".md", ".ipynb"], custom_js_files
)
LOC_TICKER = sum(language_stat.values())
LOC_TICKER = f"{LOC_TICKER:,}"