Fix linking to blog articles from index.
This commit is contained in:
parent
59c9dfcf6b
commit
6275fc3694
@ -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:
|
||||
|
@ -30,7 +30,7 @@
|
||||
{% for post in posts %}
|
||||
<div class="post-container">
|
||||
<article class="post">
|
||||
<h2 class="post-title">{{ post.title }}</h2>
|
||||
<h2 class="post-title"><a href="{{ post.link }}">{{ post.title }}</a></h2>
|
||||
<div class="post-metadata">
|
||||
<time datetime="{{ post.post_publication_date }}">
|
||||
{{ post.post_publication_date }}
|
||||
|
Loading…
Reference in New Issue
Block a user