Skip to content

Commit

Permalink
Neatly format author lists
Browse files Browse the repository at this point in the history
  • Loading branch information
Arachnid committed Mar 21, 2018
1 parent 7038c5f commit 4486c63
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
10 changes: 10 additions & 0 deletions _includes/authorlist.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{%- assign authors=include.authors|split:"," -%}
{%- for author in authors -%}
{%- if author contains "<" -%}
{%- assign authorparts=author|split:"<" -%}
<a href="mailto:{{authorparts[1]|remove:">"}}">{{authorparts[0]|strip}}</a>
{%- else -%}
{{author}}
{%- endif -%}
{% if forloop.last == false %}, {% endif %}
{%- endfor -%}
2 changes: 1 addition & 1 deletion _includes/eiptable.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ <h2>{{group.name}}</h2>
<tr>
<td><a href="{{page.url|relative_url}}">{{page.eip|xml_escape}}</a></td>
<td>{{page.title|xml_escape}}</td>
<td>{{page.author|xml_escape}}</td>
<td>{% include authorlist.html authors=page.author %}</td>
</tr>
{% endfor %}
</table>
Expand Down
6 changes: 3 additions & 3 deletions _layouts/eip.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="home">
<h1 class="page-heading">EIP {{ page.eip | xml_escape }}: {{ page.title | xml_escape }}</h1>
<table>
<tr><th>Author</th><td>{{ page.author | xml_escape }}</td></tr>
<tr><th>Author</th><td>{% include authorlist.html authors=page.author %}</td></tr>
{% if page["discussions-to"] != undefined %}
<tr><th>Discussions-To</th><td><a href="mailto:{{ page["discussions-to"] | uri_escape }}">{{ page["discussions-to"] | xml_escape }}</a></td></tr>
{% endif %}
Expand All @@ -19,10 +19,10 @@ <h1 class="page-heading">EIP {{ page.eip | xml_escape }}: {{ page.title | xml_es
<tr><th>Requires</th><td>{% include eipnums.html eips=page.requires %}</td></tr>
{% endif %}
{% if page.replaces != undefined %}
<tr><th>Replaces</th><td>{{% include eipnums.html eips=page.replaces %}</td></tr>
<tr><th>Replaces</th><td>{% include eipnums.html eips=page.replaces %}</td></tr>
{% endif %}
{% if page["superseded-by"] != undefined %}
<tr><th>Superseded by</th><td>{% include eipnums.html eips=page['superseded-by'] %}</td></tr>
<tr><th>Superseded by</th><td>{% include eipnums.html eips=page.superseded-by %}</td></tr>
{% endif %}
{% if page.resolution != undefined %}
<tr><th>Resolution</th><td><a href="{{page.resolution | uri_escape }}">{{ page.resolution | xml_escape }}</a></td></tr>
Expand Down

0 comments on commit 4486c63

Please sign in to comment.