Skip to content

Commit 3e331b8

Browse files
Add link data to the author. (#35)
Use link data to generate an appropriate link. Update Ingo user to link with Twitter.
1 parent f2ce07f commit 3e331b8

2 files changed

Lines changed: 30 additions & 10 deletions

File tree

_data/authors.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
1-
iluetkeb:
1+
# The author entry will be looked for each post.
2+
# From all the author data, 'link' will be used to locate which will be prominent in the post, as a link.
3+
# 'link' should contain the name of the data to be used; twitter, web or github are currently supported.
4+
lui3si:
5+
name: iluetkeb
26
twitter: ingoluetkebohle
7+
link: twitter
38
anordman:
49
name: Arne Nordmann
510
twitter: norro58
611
web: http://arne-nordmann.de
12+
link: twitter
713
borjaouterelo:
814
name: Borja Outerelo
915
twitter: boouga
1016
github: BorjaOuterelo
17+
link: twitter
1118
ralph-lange:
1219
name: Ralph Lange
1320
web: http://lange-ralph.de
21+
link: web

_layouts/post.html

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,28 @@ <h4>RECENT POSTS</h4>
2020
<div class="col-md-8">
2121
<h1>{{ page.title }}</h1>
2222
<p>{{ page.date | date: "%b %-d, %Y" }}
23-
{% if page.author %}
23+
{% if page.author %} <i class="fa fa-pencil fa-lg">
2424
{% assign author = site.data.authors[page.author] %}
25-
{% if author.twitter %}
26-
<a rel="author"
27-
href="https://twitter.com/{{ author.twitter }}"
28-
title="{{ author.name }}">{{page.author}}
29-
</a>
30-
{% else %}
31-
{{page.author}}
32-
{% endif %}
25+
{% case author.link %}
26+
{% when 'twitter' %}
27+
<a rel="author"
28+
href="https://twitter.com/{{ author.twitter }}"
29+
title="{{ author.name }}">{{page.author}}
30+
</a>
31+
{% when 'web' %}
32+
<a rel="author"
33+
href="{{author.web}}"
34+
title="{{ author.name }}">{{page.author}}
35+
</a>
36+
{% when 'github' %}
37+
<a rel="author"
38+
href="https://github.com/{{ author.github }}"
39+
title="{{ author.name }}">{{page.author}}
40+
</a>
41+
{% else %}
42+
{{page.author}}
43+
{% endcase %}
44+
</i>
3345
{% endif %}
3446
{% if page.meta %} • {{ page.meta }}{% endif %}</p>
3547
<div id="markdown-content-container">{{ content }}</div>

0 commit comments

Comments
 (0)