|
@@ -154,6 +154,8 @@ def main():
|
|
with open(Path.data('works.json')) as f:
|
|
with open(Path.data('works.json')) as f:
|
|
categories = yaml.safe_load(f)
|
|
categories = yaml.safe_load(f)
|
|
|
|
|
|
|
|
+ category_lookup = {c['slug']: c for c in categories}
|
|
|
|
+
|
|
# make an index page for each category
|
|
# make an index page for each category
|
|
with Path.write('category', 'index.html') as f:
|
|
with Path.write('category', 'index.html') as f:
|
|
f.write(Template.main({
|
|
f.write(Template.main({
|
|
@@ -192,11 +194,21 @@ def main():
|
|
# report other works in their own year
|
|
# report other works in their own year
|
|
copy = f'© Getty Ritter {w.date}'
|
|
copy = f'© Getty Ritter {w.date}'
|
|
|
|
|
|
|
|
+ if slug in category_lookup:
|
|
|
|
+ singular = category_lookup[slug]['singular']
|
|
|
|
+ description = f'{w.title}: a {singular}'
|
|
|
|
+ else:
|
|
|
|
+ description = '...'
|
|
with Path.write(w.slug, 'index.html') as f:
|
|
with Path.write(w.slug, 'index.html') as f:
|
|
f.write(Template.main({
|
|
f.write(Template.main({
|
|
'title': w.title,
|
|
'title': w.title,
|
|
'contents': text,
|
|
'contents': text,
|
|
'copy': copy,
|
|
'copy': copy,
|
|
|
|
+ 'opengraph': {
|
|
|
|
+ 'title': w.title,
|
|
|
|
+ 'url': f'/{w.slug}/',
|
|
|
|
+ 'description': description,
|
|
|
|
+ },
|
|
}))
|
|
}))
|
|
works.append(w)
|
|
works.append(w)
|
|
works.sort(key=lambda w: w.slug)
|
|
works.sort(key=lambda w: w.slug)
|