Open saikadaramakaisosjupita opened 8 months ago
Example of using the authors taxonomy to handle site and page authors. Works fine for one or many authors.
git clone --single-branch -b hugo-forum-topic-48874 https://github.com/jmooring/hugo-testing hugo-forum-topic-48874
cd hugo-forum-topic-48874
hugo server
Files of interest:
See comments in partial headers for details.
This approach takes some time to setup, but is infinitely extensible.
Part of this is documented here: https://gohugo.io/templates/taxonomy/#display-metadata
@jmooring I am assuming your comment means this will be documented eventually?
this will be documented eventually?
Yes, that's why the issue is open.
I don't understand what was wrong with using author
in the frontmatter. As someone new to using Hugo this is frustrating and I see it as an unnecessary change.
You can create an author
front matter parameter. For example:
[params.author]
email = 'jdoe@example.org'
name = 'John Doe'
Then access the value from a template:
{{ .Params.author.name }}
{{ .Params.author.email }}
What you can't do (deprecated):
{{ .Author }}
You can create an authors
front matter parameter. For example:
[[params.authors]]
email = 'jdoe@example.org'
name = 'John Doe'
[[params.authors]]
email = 'rsmith@example.org'
name = 'Robert Smith'
Then access the values from a template:
{{ range .Params.authors }}
{{ .name }}
{{ .email }}
{{ end }}
What you can't do (deprecated):
{{ .Authors }}
for me i just replace [author] with [params.author] thanks.
Like using taxonomies, site Params, etc.
See https://discourse.gohugo.io/t/deprecation-warning-for-site-author-confusing-replacement-advice/48874