I don’t understand Go language, but can sort of guess the syntax… I was looking at site.go, but looks like Authors variables of type AuthorList is only declared, but not assigned a value anywhere… is that right?
The reason I am posting this is that no matter how I define Authors (note: notAuthor) in my config.toml, the twitter_cards template is not picking those up.
One attempt:
[[Authors]]
twitter = "foo"
Another attempt (anyways nothing worked, so just tried putting [Authors.Social] in there because author.go shows a Social var in Author struct:
[[Authors]]
[Authors.Social]
twitter = "foo"
I am making Authors a TOML Array of Tables, because that range says that that’s supposed to be an array of “author objects” (just like .Resources)… so am copying the TOML style of defining Resources in page front-matter.
Am I making a mistake in defining Authors in the config.toml?
Or should I be defining those there? (I assume so, because we are looking for .Site.Authors)
Or is really assigning values to .Site.Authors not implemented in hugo?
I’ve just spent the last half hour or so trying to figure this out myself.
It looks like it’s a half implemented feature that the developers just didn’t get around to hooking up. It seems that a number of the _internal templates use the .Site.Authors data - but then a lot of those aren’t documented either.
It’s a shame as an easy way to add author/s information to posts would be great!
If you are dealing with multiple authors, you can instead create an array of such maps (tables of tables in TOML lingo) in the [Params] in config.toml.
There have been extensive conversations about authors implementation both here and in GitHub. I’m not exactly sure where things left off but there were some pretty good prototypes for multi-author blogs, with author profiles, floating around somewhere: https://discourse.gohugo.io/search?q=author.