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?
– fernandosavio
assigns yes, I’ll edit by putting the front Matter. I forgot about it
– Bruno Folle
Apparently it would just be using
page.author
. According to the documentation the variableauthor
is not automatically available, but all front Matter variables are displayed in the variablepage
– fernandosavio
So instead of using post.Uthor I use page.Uthor?
– Bruno Folle
You need to test, but from the documentation that’s right
– fernandosavio
I tested and nothing either
– Bruno Folle