add author on home posts list

This commit is contained in:
Ayo Ayco 2018-03-13 06:56:16 +08:00
parent c550995491
commit 2cf356f673

View file

@ -9,8 +9,13 @@ layout: default
<ul class="post-list"> <ul class="post-list">
{% for post in site.posts %} {% for post in site.posts %}
<li> <li>
{% assign date_format = site.minima.date_format | default: "%b %-d, %Y" %} <span class="post-meta">
<span class="post-meta">{{ post.date | date: date_format }}</span> {% if post.author %}
<span itemprop="author" itemscope itemtype="http://schema.org/Person"><span class="p-author h-card" itemprop="name">{{ post.author }}</span></span>
{% endif %}
{% assign date_format = site.minima.date_format | default: "%b %-d, %Y" %}
{{ post.date | date: date_format }}
</span>
<h3> <h3>
<a class="post-link" href="{{ post.url | relative_url }}">{{ post.title | escape }}</a> <a class="post-link" href="{{ post.url | relative_url }}">{{ post.title | escape }}</a>
</h3> </h3>