How To Manage Authorship As Hugo Theme
When a page consists of various contributors, writers, and editors, it can be messy to manage the authorship and copyright references. Bissetii sorted it out for Hugo using Map data based on Schema.org structured data.
This feature is available since version
How it Works: Using Hugo’s TOML Map Table
After researching for scalability and trying to resolve many authorship problems, Bissetii decided to opt for using TOML Map Table inside Hugo’s configurations file and page’s front-matter. The pattern is something as follows:
[john-smith] type = "Person" name = "John Smith" [success-team] type = "Organization" name = "Success Team"
By using map table, both site-level and page-level authors are uniquely sorted out automatically, saving the problem of repetition.
The fields inside each creator is strictly defined by Schema.org. Some important fields are:
name- the full name in string.
Bissetii renders the list of authors to many SEO components like meta tags, Schema.org LD+JSON script, twitter authors, open graph tags, and etc.
There are 2 ways to setup the authors depending on your desired area of effect.
These settings affects every pages in the Hugo content. Should the any Page-level authorships is defined, the Site-level authorships will be overwritten by it.
To set Site-Level Authorship, you declare the creators map tables inside the following:
pattern : data/creators.toml directory : docs/.data/ repo-docs : docs/.data/creators.toml
One example would be:
For page specific authorship, one can set it inside the page’s front matter.
If the creator map name (e.g.
[creators.JohnSmith]) is the same as the
Site-Level Authorship, the latter will be overwritten.