Skip to content

Commit

Permalink
A bit nicer representation of authors for posts.
Browse files Browse the repository at this point in the history
  • Loading branch information
shagie committed Feb 20, 2016
1 parent 58e0b1a commit ad55466
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
4 changes: 4 additions & 0 deletions _data/authors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
MichaelT:
#web: http://shagie.net/
gravatar: 5c5509b15c1d77824b8b3be18d8820a3
github: shagie
12 changes: 10 additions & 2 deletions _layouts/post.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
---
layout: default
---
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
{% assign author = site.data.authors[page.author] %}

<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
<header class="post-header">
<h1 class="post-title" itemprop="name headline">{{ page.title }}</h1>
<p class="post-meta"><time datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">{{ page.date | date: "%b %-d, %Y" }}</time>{% if page.author %} • <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">{{ page.author }}</span></span>{% endif %}</p>
<p class="post-meta"><time datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">{{ page.date | date: "%b %-d, %Y" }}</time></p>
{% if page.author %}
<p class="post-meta">by
{% if author.gravatar %}<img src="http://s.gravatar.com/avatar/{{ author.gravatar }}?s=20">{% endif %}
<span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">{{ page.author }}</span></span>
{% if author.web %}(<a href="{{ author.web }}">{{ author.web }}</a>){% endif %}
</p>
{% endif %}
</header>

<div class="post-content" itemprop="articleBody">
Expand Down
2 changes: 1 addition & 1 deletion _posts/2016-02-16-five-books-michaelt.markdown
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: post
title: Five Books Every Programmer Should Read (MichaelT)
title: Five books every programmer should read
date: 2016-02-16 20:56:50 -0600
categories: book review
author: MichaelT
Expand Down
2 changes: 1 addition & 1 deletion _posts/2016-02-19-five-languages-michaelt.markdown
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: post
title: Five languages to know (MichaelT)
title: Five languages to know
date: 2016-02-19 17:49:26 -0600
categories: language
author: MichaelT
Expand Down
8 changes: 4 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ <h1 class="page-heading">Posts</h1>
{% for post in site.posts %}
<li>
<span class="post-meta">{{ post.date | date: "%b %-d, %Y" }}</span>

<h2>
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
</h2>
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
{% if post.author %}
<span class="post-meta">by: {{ post.author | "unknown" }}</span>
{% endif %}
</li>
{% endfor %}
</ul>
Expand Down

0 comments on commit ad55466

Please sign in to comment.