gohugoio/hugoBasicExample

.Site.Author requires a map, this repo uses a flat "author = " variable

danielfdickinson opened this issue · 0 comments

Summary

This issue is being created with the intent for myself ( @danielfdickinson ) to create a PR to fix it, shortly.

The problem in a nutshell is that

author = "Steve Francia"
is a 'flat' (scalar) variable but .Site.Author expects a map.

Discussion

During a thread on the Hugo forum called .Site.Author Usage?, it was pointed out that the docs say .Site.Author expects config.toml to have an author map .

This repo has author = "Steve Francia"

author = "Steve Francia"

which is a 'flat' (scalar) variable, which as far .Site.Author is concerned is an empty map (as verified with a testing).

In addition, apparently the internal RSS template expects a map which has 'name' and 'email' as keys

E.g.

[author]
name = "Your Name"
email = "you@yexample.com"

Further, .Site.Author can handle having an 'authors' key which is a map with multiple subkeys (site-dependent values).

This is potentially useful for consistency in theme design for handling authorship.

Conclusion

The expected definition of author seems to have changed from scalar to map, and this repo should reflect that. (PR to be added later today).