Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Multiple authors on Jekyll
authors:
hanzou:
name: Hanzou Hattori
display_name: Hanzou
gravatar: c66919cb194f96c696c1da0c47354a6a
email: hanzou@company.com
web: http://company.com
twitter: company
github: hhattori
jorgen:
name: Jörgen Mortensen
display_name: Jörgen
gravatar: 12e480a364a5c19214f99b4dfe9a11d5
email: jorgen@company.com
web: http://company.com
twitter: company
github: jorgenm
{% assign author = site.authors[page.author] %}
<article class="entry">
<header>
<p class="date">
<span class="month">{{ page.date | date: '%b' }}</span>
<span class="day">{{ page.date | date: '%d' }}</span>
<span class="year">{{ page.date | date: '%Y' }}</span>
</p>
<h1>{{ page.title }}</h1>
<p class="byline">
by {{ author.display_name }}
</p> <!-- /.byline -->
</header>
</article>
---
layout: post
title: "Migrating from Tumblr to Jekyll"
author: jorgen
tags: [ Tumblr, Jekyll, tutorial ]
css_classes: [ permalink ]
---
@seufelipe

This comment has been minimized.

Copy link

commented Jan 15, 2013

ravasthi, how could i list all the authors eg. in a humans.txt file?

@keith

This comment has been minimized.

Copy link

commented Aug 15, 2013

@seufelipe just a basic jekyll for loop would probably do:

{% for author in site.authors %}
  {{ author.name }} -- {{ author.email }}
{% endfor %}
@ngunner

This comment has been minimized.

Copy link

commented Jan 8, 2014

Just what I needed. Thanks!

@SirRawlins

This comment has been minimized.

Copy link

commented Jan 23, 2014

This works a charm - a really nicely little gist.

@dustinlarimer

This comment has been minimized.

Copy link

commented Aug 2, 2014

Awesome! thank you!

@sqorandy

This comment has been minimized.

Copy link

commented Jun 30, 2015

This isn't working for me. I am using the exact set up, but cannot render a list of all of the authors. Has this changed? To clarify, I am referring to @keith regarding the for loop. Did that work for you?

@kuka

This comment has been minimized.

Copy link

commented Sep 21, 2015

@sqorandy, did you figure out a solution?

@schiller

This comment has been minimized.

Copy link

commented Sep 29, 2015

This worked for me:

{% for author in site.authors %}
  {{ author[1].name }} -- {{ author[1].email }}
{% endfor %}
@polodev

This comment has been minimized.

Copy link

commented May 9, 2018

How to all post by a author

@BlkPingu

This comment has been minimized.

Copy link

commented Jul 16, 2018

+1 @polodev i need this too. How to list all posts by author with multiple authors PER post. Like one post can have multiple authors ( like in scientific papers) while I want to list all authors in a list with the number of posts that they where writing on.

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.