aboutsummaryrefslogtreecommitdiff
path: root/blog/generate_html.py
diff options
context:
space:
mode:
Diffstat (limited to 'blog/generate_html.py')
-rwxr-xr-xblog/generate_html.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/blog/generate_html.py b/blog/generate_html.py
index 7360fa3..1d8d063 100755
--- a/blog/generate_html.py
+++ b/blog/generate_html.py
@@ -31,6 +31,7 @@ def main():
with open("template.html", "r") as fp:
template = fp.read()
+ article_list = "<ul>\n"
article_html = ""
# Get articles from rss
@@ -49,10 +50,18 @@ def main():
# Remove article tags.
article = article[article.find("<article>")+9::]
article = article[:article.find("</article>"):]
+
+ # Add article table to html
article_html += make_article_table(article_info, article)
+ # Add article to list.
+ article_list += \
+ f"<li><a href=\"#{article_info["name"]}\">{article_info["title"]}</a></li>\n"
+
+ article_list += "</ul>"
+
# Format the articles into the html
- template = template.format(articles=article_html)
+ template = template.format(article_list=article_list, articles=article_html)
print(template)
if __name__ == "__main__":