I followed this documentation to create an author profile (/data/_authors/plegare.toml) and I added it to my posts meta as said in the docs (authors = [“plegare”]). I’m rendering my post with the _default/single.html
template, using {{ .Author.DisplayName }} to display the author’s name, but the result is empty. Any idea why? Thanks a lot for the help
There are a lot of steps to using that. Have you checked if the examples worked after you added author data? I’d run through those and ensure they work, because then you know if you missed an earlier step.
Thanks for the help I followed the examples and I got the “Listing each author’s publications” to work (/authors/alice showed her articles). However, got an error I’m not able to figure out on “Listing all authors”, which is
ERROR 2017/05/10 17:55:15 Error while rendering "taxonomyTerm": template: taxonomy/author.terms.html:3:20: executing "taxonomy/author.terms.html" at <$.Authors.Get>: Get is not a method but has arguments
It’s not related to my setup though I think, so I still don’t see what should I change in my setup… I also tried it with {{ .Author.ShortBio }} without success. This is the content of my _default/single.html :
{{ partial "head.html" . }}
{{ partial "header.html" . }}
{{ .Content }}
<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
<span>written by {{ .Author.DisplayName }}</span>
{{ .Summary }}
{{ partial "footer.html" . }}
I did some testing to make sur it was really this template that was rendered, and it definitely is. Any thoughts ?
As far as I understand, this feature will work only in the next version. https://github.com/spf13/hugo/issues/3088
Thanks for pointing this out. That’s too bad but I’ll keep up-to-date for next time