In config.toml (currently the 2nd user is commented out, but you can define as many authors that contribute on your site)
[params.authors]
[params.authors.hash]
name = "Hash Borgir"
bio = "Hash is a Software Developer and generally a tech geek and computer nerd. He also consumes massive quantities of Cannabis and takes extremely deep journeys inwardly, meditates, explores the Universe within."
location = "Colorado, USA"
email = ""
twitter= "HashBorgir"
image = "/images/authors/Hash_Borgir/user.jpg"
instagram = "hashborgir"
#[params.authors.guest]
# name = "Guest Writer"
#
# bio = "Guest author profile. No bio. "
#
# location = "Colorado, USA"
# email = ""
# twitter= ""
# image = "/images/authors/Guest/gust.jpg"
# instagram = ""
And then in my theme I have this file
/layouts/partials/widgets/authors.html
`
{{ $baseurl := .Site.BaseURL }}
Resident Authors
<div class="panel-body">
<div class="authors-list">
{{ range $name, $items := .Site.Params.authors }}
{{ range $key, $val := $items }}
{{ if eq $key "name" }}
<p><a href="{{ $baseurl }}authors/{{ $val | urlize | lower }}"><i class="fa fa-tags"></i> {{ $val }}</a>
</p>
{{ end }}
{{ end }}
{{ end }}
</div>
</div>
and then in config.toml
[taxonomies]
author="authors"
then make a new folder called
/content/authors/
and then create a folder for the author name for example /content/authors/hash-borgir/my_article.md
And in the front matter of your article, you must have:
authors = "hash-borgir"
author="hash"
The context of .Params.author will go into the array of .Site.Params.authors and pull the relevant author and display him, so we specify his name = “Hash Borgir” so we make a slug of it, authors = “hash-borgir”
Now you can have site.com/authors/hash-borgir or site.com/authors/guest or site.com/authors/jilly-milly
and their own individual articles wil only show up in their name.
you must also create
/layout/taxonomy/author.html
and in this file you must put: .Pages variable but not .Site.Pages or something
and you can refer to your author as this:
{{$author := index .Site.Params.authors (.Params.author) }}
and now you can refer to your author fields from config.toml as
$author.name or $author.twitter etc.
Thank you, I will make a blog post from this soon.