From 68b2b7737bf6d48035937cd01536f4b25078709d Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Fri, 17 Jul 2020 19:00:21 +0200 Subject: [PATCH] Link 'This Month in Rust OSDev' posts in status updates section --- blog/before_build.py | 9 +++++++++ blog/templates/auto/status-updates.html | 0 blog/templates/second-edition/index.html | 4 +--- blog/templates/status-update-section.html | 1 + 4 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 blog/templates/auto/status-updates.html diff --git a/blog/before_build.py b/blog/before_build.py index c0195cfb..c2870d41 100644 --- a/blog/before_build.py +++ b/blog/before_build.py @@ -47,3 +47,12 @@ with io.open("templates/auto/stars.html", 'w', encoding='utf8') as stars: with io.open("templates/auto/forks.html", 'w', encoding='utf8') as forks: forks.truncate() forks.write(format_number(repo.forks_count)) + +with io.open("templates/auto/status-updates.html", 'w', encoding='utf8') as status_updates: + status_updates.truncate() + + pulls = g.search_issues("is:merged", repo="rust-osdev/homepage", type="pr", label="next-post")[:5] + + for pr in sorted(pulls, key=lambda issue: issue.closed_at, reverse=True): + link = '' + pr.title + " " + status_updates.write(u"
  • " + link + "
  • \n") diff --git a/blog/templates/auto/status-updates.html b/blog/templates/auto/status-updates.html new file mode 100644 index 00000000..e69de29b diff --git a/blog/templates/second-edition/index.html b/blog/templates/second-edition/index.html index 5facb3c0..f3371364 100644 --- a/blog/templates/second-edition/index.html +++ b/blog/templates/second-edition/index.html @@ -59,9 +59,7 @@ {% set status_updates = get_section(path = "status-update/_index.md") %}

    {{ status_updates.description }}

    diff --git a/blog/templates/status-update-section.html b/blog/templates/status-update-section.html index 854ac622..43e79cc1 100644 --- a/blog/templates/status-update-section.html +++ b/blog/templates/status-update-section.html @@ -13,6 +13,7 @@ {% endblock introduction %}