Lego2012
7/10/2017 - 8:22 AM

Authors Page

Authors Page

I assume you have author: authors in your config.yml under taxonomies:. I assume, for example, that if you have an author named Ryan Watters, you have a content file for said author at content/authors/ryan-watters/_index.md. I assume that when you add an author to a content file, you do so using authors: [Ryan Watters, John Doe], etc...

So here is what you need for something like layouts/_default/single.html:

<!--Somewhere in layouts/_default/single.html-->
{{ with .Params.authors }}
  {{ range $ind,$val := . }}
    {{$author := $val | urlize }}
    {{- with $.Site.GetPage "taxonomyTerm" "authors" $author}}
      <p>Name = {{ .Params.name }} </p>
      <p>Bio = {{ .Params.bio }}</p>
      <p>Photo = {{.Params.photo}}</p>
      <p>Here is the content from this author's _index.md file:</p>
      {{.Content}}
    {{ end -}}
  {{ end }}
{{ end }}