How to print the post Author in Jekyll

Asked

Viewed 26 times

0

I’m trying to print the author of the post when I rotate the loop to list the posts on the index, but I can’t do it.

Does anyone have any idea?

Follows the code:

{% for post in site.posts %}    
    {% assign author = site.authors[post.author] %}
    {{author.name}} // não printa nada aqui 
{% endfor %}

_config.yml:

authors:
  bruno_folle:
    name: Bruno Folle

front Matter:

---
layout: post
title:  "Welcome to Jekyll!"
date:   2018-09-17 12:58:34 +0200
categories: jekyll update
author: bruno_folle
---
  • You assign some author in the front header of posts?

  • assigns yes, I’ll edit by putting the front Matter. I forgot about it

  • Apparently it would just be using page.author. According to the documentation the variable author is not automatically available, but all front Matter variables are displayed in the variable page

  • So instead of using post.Uthor I use page.Uthor?

  • You need to test, but from the documentation that’s right

  • I tested and nothing either

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.