Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Display author(s), reliant on a 'post' loop.
{% if post.author %}
{% assign author = site.data.authors[post.author] %}
{% assign p = post %}
{% else %}
{% assign author = site.data.authors[page.author] %}
{% assign p = page %}
{% endif %}
<div class="author">
<div class="image">
<img src="{{ author.img }}" alt="{{ author.name }}" width="50" height="50">
</div>
<div class="author_info">
<span class="name">{{ author.name }}</span>
<span class="date">{{ p.date | date: '%B %d, %Y' }}</span>
</div>
</div>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>{{ page.title }}</title>
<meta name="viewport" content="width=device-width">
{% include social_meta.inc %}
{% include styles.inc %}
</head>
<body>
{% include facebook_js.inc %}
{% include twitter_js.inc %}
<header>
{% include content_header.inc %}
</header>
<div class="area_wrap page_content">
{% for post in site.posts %}
<a href="{{ post.url }}"><h1>{{ post.title }}</h1></a>
<p class="meta">{{ post.date | date: '%B %d, %Y' }}</p>
<div class="post">
{{ post.content }}
</div>
<div class="area_wrap post_data">
{% include author.inc %}
<div class="social_links">
<h4>Share this post:</h4>
{% include twitter_button.inc %}
{% include facebook_button.inc %}
</div>
</div>
{% endfor %}
</div>
{% include footer.inc %}
{% include analytics.inc %}
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.