jekyll-bootstrap
jekyll-bootstrap copied to clipboard
Authors Page - Posts By Author
We were in need of this sort of page, as we no longer wanted to link authors to tags (case sensitivity becoming a problem) so we put this together. It lists authors, sorted, and their posts, sorted by article name:
---
layout: page
title: Authors
subtitle: Posts By Author
group: navigation
---
{% include JB/setup %}
{% capture rawauthors %}{% for post in site.posts %}{% if post.author %}{{ post.author }}|{% endif %}{% endfor %}{% endcapture %}
{% assign authors = rawauthors | split:'|' | sort %}
<section id="site-authors">
{% for author in authors %}
{% capture rawposts %}{% for post in site.posts %}{% if post.author == author %}{{ post.title }}*{{ post.url }}|{% endif %}{% endfor %}{% endcapture %}
{% assign posts = rawposts | split:'|' | sort %}
<h2 id="{{ author | downcase }}-ref">{{ author }}</h2>
{% for post in posts %}
<ul>
{% assign parts = post | split:'*' %}
<li><a href="{{ BASE_PATH }}{{ parts[1] }}">{{ parts[0] }}</a></li>
</ul>
{% endfor %}
{% endfor %}
</section>
This would be a keen addition to Jekyll Bootstrap