Skip to content

Commit 71cd22c

Browse files
committed
Add support for multiple article authors as well as userpic specification to support username changes.
1 parent bc01c87 commit 71cd22c

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

_layouts/article.html

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,24 @@ <h1 id="top">{{ page.title }}</h1>
1919
{% endif %}
2020

2121
{% if page.author %}
22+
{% assign authors = page.author | split: "," %}
2223
<div class="author">
23-
<img src="https://retroachievements.org/UserPic/{{ page.author }}.png" alt="{{ page.author }}">
24-
<span>By
25-
<a href="https://retroachievements.org/user/{{ page.author }}">
26-
{{ page.author }}</a>.
24+
{% for author in authors %}
25+
{% assign author_parts = author | strip | split: ":" %}
26+
{% assign author_name = author_parts[0] %}
27+
{% if author_parts[1] %}
28+
{% assign author_pic = author_parts[1] %}
29+
{% else %}
30+
{% assign author_pic = author_name %}
31+
{% endif %}
32+
<img src="https://retroachievements.org/UserPic/{{ author_pic }}.png" alt="{{ author_name }}">
33+
{% endfor %}
34+
<span>By
35+
{% for author in authors %}
36+
{% assign author_parts = author | strip | split: ":" %}
37+
{% assign author_name = author_parts[0] %}
38+
<a href="https://retroachievements.org/user/{{ author_name }}">{{ author_name }}</a>{% unless forloop.last %}, {% endunless %}
39+
{% endfor %}.
2740
</span>
2841
</div>
2942
{% endif %}

0 commit comments

Comments
 (0)