Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Authors Page - Posts By Author #277

Open
shellscape opened this issue Jun 23, 2015 · 0 comments
Open

Authors Page - Posts By Author #277

shellscape opened this issue Jun 23, 2015 · 0 comments

Comments

@shellscape
Copy link

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant