Skip to content

Commit 93793f3

Browse files
restructure + new post + a11y
* new post * restructure URL format * add alt text on images
1 parent 726b39b commit 93793f3

File tree

123 files changed

+3244
-1424
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+3244
-1424
lines changed

‎.vscode/settings.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"defun",
44
"funcs",
55
"longjmp",
6+
"Nuvoton",
67
"oldenv",
78
"phoo",
89
"Roboraptor",

‎build.py

+30-16
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
SITESUBTITLE = 'random thoughts about nonrandom things'
1313
SITEURL = 'https://dragoncoder047.github.io/blog'
1414
LOGO = '/images/patrick.svg'
15-
LOGO_AREA_HTML = f'<a href="{SITEURL}"><div class="flex-row"><img src="{LOGO}" width="141" alt="Patrick the purple dragon" height="85" /><div id="sitename-text" class="flex-column"><h1>{SITENAME}</h1><h2>{SITESUBTITLE}</h2></div></div></a>'
15+
LOGO_AREA_HTML = (f'<a href="{SITEURL}"><div class="flex-row"><img src="'
16+
+ f'{LOGO}" width="141" alt="Patrick the purple dragon"'
17+
+ 'height="85" /><div id="sitename-text" class="flex-'
18+
+ f'column"><h1>{SITENAME}</h1><h2>{SITESUBTITLE}</h2>'
19+
+ '</div></div></a>')
1620
ICON = '/images/patrick_head_silhouette.svg'
1721
ICON_MIMETYPE = 'image/svg+xml'
1822
THEME_CSS_FILE = '/static/css/theme.css'
@@ -48,21 +52,25 @@
4852
DISPLAY_PAGES_ON_MENU = True
4953
DISPLAY_CATEGORIES_ON_MENU = False
5054

51-
ARTICLE_SAVE_AS = ARTICLE_URL = '{path_no_ext}.html'
52-
PAGE_URL = PAGE_SAVE_AS = 'page/{slug}.html'
55+
ARTICLE_URL = '{date:%Y}/{slug}'
56+
ARTICLE_SAVE_AS = ARTICLE_URL + '/index.html'
57+
PAGE_URL = 'page/{slug}'
58+
PAGE_SAVE_AS = PAGE_URL + '/index.html'
5359
AUTHOR_SAVE_AS = AUTHOR_URL = '' # 'author/{slug}.html' # I am the only author
5460
AUTHORS_SAVE_AS = '' # 'authors.html'
55-
DRAFT_URL = DRAFT_SAVE_AS = DRAFT_PAGE_URL = DRAFT_PAGE_SAVE_AS = 'drafts/{path_no_ext}.html'
56-
CATEGORY_SAVE_AS = CATEGORY_URL = '' # 'category/{slug}.html'
57-
CATEGORIES_SAVE_AS = '' # 'categories.html' # I don't use categories
58-
TAG_SAVE_AS = TAG_URL = 'tag/{slug}.html'
59-
TAGS_SAVE_AS = 'tags.html'
60-
ARCHIVES_SAVE_AS = 'archives.html'
61+
DRAFT_URL = '_draft/{slug}'
62+
DRAFT_SAVE_AS = DRAFT_URL + '/index.html'
63+
DRAFT_PAGE_URL = '_draft_page/{slug}'
64+
DRAFT_PAGE_SAVE_AS = DRAFT_PAGE_URL + '/index.html'
65+
TAG_URL = 'tag/{slug}'
66+
TAG_SAVE_AS = TAG_URL + '/index.html'
67+
TAGS_URL = 'tags'
68+
TAGS_SAVE_AS = 'tags/index.html'
69+
ARCHIVES_URL = 'archives'
70+
ARCHIVES_SAVE_AS = 'archives/index.html'
6171

6272
USE_CATEGORES = False
6373

64-
PATH_METADATA = r'(?P<path_no_ext>.*)\..*'
65-
6674
# Blogroll
6775
LINKS = (
6876
('Conwaylife', 'https://www.conwaylife.com/'),
@@ -76,7 +84,8 @@
7684
)
7785

7886
MENUITEMS = (
79-
('Archives', f'{SITEURL}/{ARCHIVES_SAVE_AS}'),
87+
('Archives', f'{SITEURL}/{ARCHIVES_URL}'),
88+
('By tag', f'{SITEURL}/{TAGS_URL}'),
8089
('Site root', '/'),
8190
('Projects', '#', (
8291
('Thuepaste', f'https://{AUTHOR}.github.io/thuepaste'),
@@ -91,7 +100,7 @@
91100
DEFAULT_ORPHANS = 3
92101
PAGINATION_PATTERNS = (
93102
(1, '{name}{extension}', '{name}{extension}'),
94-
(2, '{name}_{number}{extension}', '{name}_{number}{extension}'),
103+
(2, '{name}{number}{extension}', '{name}{number}{extension}'),
95104
)
96105

97106
THEME = './pelicantheme'
@@ -100,7 +109,11 @@
100109

101110

102111
def lv_fence(source, language, css_class, options, md, **kwargs):
103-
return f'<div class="lifeviewer"><textarea>{source.replace("AUTOSTART", "")}\n[[ EXCLUSIVEPLAY ]]</textarea><canvas height="{options.get("height", 400)}" width="{options.get("width", 600)}"></canvas></div>'
112+
return ('<div class="lifeviewer"><textarea>'
113+
+ f'{source.replace("AUTOSTART", "")}'
114+
+ '\n[[ EXCLUSIVEPLAY ]]</textarea><canvas height="'
115+
+ f'{options.get("height", 400)}"'
116+
+ 'width="{options.get("width", 600)}"></canvas></div>')
104117

105118

106119
def kroki_fence(source, language, css_class, options, md, **kwargs):
@@ -115,11 +128,12 @@ def kroki_fence(source, language, css_class, options, md, **kwargs):
115128

116129
def named_kroki(name):
117130
def named_fence(source, language, css_class, options, md, **kwargs):
118-
return kroki_fence(source, language, css_class, options | {'type': name}, md, **kwargs)
131+
return kroki_fence(source, language, css_class,
132+
options | {'type': name}, md, **kwargs)
119133
return {'name': name, 'class': name, 'format': named_fence}
120134

121135

122-
def schemascii_fence(source, language, css_class, options, md, attrs, **kwargs):
136+
def schemascii_fence(source, lang, cls, opts, md, attrs, **kwargs):
123137
try:
124138
return schemascii.render("markdown-block", source, **attrs)
125139
except (schemascii.Error, Exception) as err:

‎docs/updating_python.html renamed to ‎docs/2021/updating-python/index.html

+8-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

‎docs/pydrop.html renamed to ‎docs/2022/airdrop-for-non-apple-users/index.html

+15-13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎docs/popover_css.html renamed to ‎docs/2022/almost-no-javascript/index.html

+9-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)