commit 6a6eb7a0c39405b706d2ac6f7a25b6f0860a404b parent 9b7da0b17610e8aaf443ec369d7d3bd86a30c440 Author: Oscar Benedito <oscar@oscarbenedito.com> Date: Sat, 26 Sep 2020 21:55:13 +0200 Change categories' description files path Diffstat:
9 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/content/blog/categories/cryptography/_index.md b/content/blog/categories/cryptography.md diff --git a/content/blog/categories/decentralization/_index.md b/content/blog/categories/decentralization.md diff --git a/content/blog/categories/foss/_index.md b/content/blog/categories/foss.md diff --git a/content/blog/categories/miscellany/_index.md b/content/blog/categories/miscellany.md diff --git a/content/blog/categories/personal-domain/_index.md b/content/blog/categories/personal-domain.md diff --git a/content/blog/categories/privacy/_index.md b/content/blog/categories/privacy.md diff --git a/content/blog/categories/projects/_index.md b/content/blog/categories/projects.md diff --git a/content/blog/categories/self-hosting/_index.md b/content/blog/categories/self-hosting.md diff --git a/gensite.py b/gensite.py @@ -244,13 +244,13 @@ def make_pages(src, dst, layout, blog=False, **params): return items, categories -def make_lists(posts, dst, list_layout, item_layout, **params): +def make_lists(posts, dst, list_layout, item_layout, src=None, **params): """Generate HTML lists for a blog.""" item_per_page = 5 items = [] count = 1 page_dst = dst - text = fread('content/' + dst + '_index.md') + text = fread(src) if src else fread('content/' + dst + '_index.md') params['intro'] = markdown.markdown(text, extensions=['footnotes', 'fenced_code']) for i, post in enumerate(posts): item_params = dict(params, **post) @@ -398,10 +398,11 @@ def main(): # create blog categories for name, posts in categories.items(): dst = 'blog/categories/' + urlize(name) + '/' + src = 'content/blog/categories/' + urlize(name) + '.md' lt = name + ' on Oscar\'s Blog' eh = '<link rel="alternate" type="application/atom+xml" title="' + lt + '" href="/' + dst + 'index.xml"/>' - make_lists(posts, dst, list_html, item_html, title=name, extraheader=eh, - **params) + make_lists(posts, dst, list_html, item_html, src=src, title=name, + extraheader=eh, **params) make_feed(posts, dst, feed_xml, item_xml, title=name, long_title=lt, **params)