Link 'This Month in Rust OSDev' posts in status updates section

This commit is contained in:
Philipp Oppermann
2020-07-17 19:00:21 +02:00
parent 3096baf462
commit 68b2b7737b
4 changed files with 11 additions and 3 deletions

View File

@@ -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 = '<a href="' + pr.html_url + '">' + pr.title + "</a> "
status_updates.write(u" <li>" + link + "</li>\n")

View File

View File

@@ -59,9 +59,7 @@
{% set status_updates = get_section(path = "status-update/_index.md") %}
<p>{{ status_updates.description }}</p>
<ul>
{% for page in status_updates.pages | slice(end=3) %}
<li><b><a href="/{{ page.path | safe }}">{{ page.title }}</a></b></li>
{% endfor %}
{% include "auto/status-updates.html" %}
<li><a href="{{ get_url(path="@/status-update/_index.md") | safe }}"><em>view all »</em></a></li>
</ul>
</div>

View File

@@ -13,6 +13,7 @@
{% endblock introduction %}
<div><ul>
{% include "auto/status-updates.html" %}
{% for page in section.pages %}
<li><b><a href="/{{ page.path | safe }}">{{ page.title }}</a></b></li>
{% endfor %}