diff --git a/scripts/blog.py b/scripts/blog.py index 74a5800..7ddc083 100644 --- a/scripts/blog.py +++ b/scripts/blog.py @@ -207,6 +207,7 @@ def render_index(docs, dest_top): "post_publication_date": front_matter['date'], "post_tags": split_tags(front_matter['tags']), "summary": summarize(doc), + "link": out_path.rstrip('/') + '/', } for (doc, front_matter, out_path) in page ] @@ -232,7 +233,9 @@ def regen_all(source_top, dest_top, docs=None): doc_full_path = os.path.join(dest_top, out_path) os.makedirs(os.path.dirname(doc_full_path), exist_ok=True) # print("==", doc_full_path) - with open(doc_full_path + '.html', 'wt') as f: + out_path = doc_full_path + '/index.html' + os.makedirs(os.path.dirname(out_path), exist_ok=True) + with open(out_path, 'wt') as f: try: render_article(doc, front_matter, f) except: @@ -325,7 +328,7 @@ def main(source_top, dest_top): doc_full_path = os.path.join(dest_top, out_path) os.makedirs(os.path.dirname(doc_full_path), exist_ok=True) # print("==", doc_full_path) - with open(doc_full_path + '.html', 'wt') as f: + with open(doc_full_path + '/index.html', 'wt') as f: try: render_article(doc, front_matter, f) except: diff --git a/static/blog_index.tmpl.html b/static/blog_index.tmpl.html index 4be44b9..7ba8570 100644 --- a/static/blog_index.tmpl.html +++ b/static/blog_index.tmpl.html @@ -30,7 +30,7 @@ {% for post in posts %}
-

{{ post.title }}

+

{{ post.title }}