page_author.html 861 B

12345678910111213141516171819
  1. {{/* Author profile box */}}
  2. {{/* Don't show author box on normal pages or if author box disabled. */}}
  3. {{ if ne .Type "page" | and (not (or (eq site.Params.profile false) (eq .Params.profile false))) }}
  4. {{/* Display superuser if superuser exists and page authors are not explicitly specified. */}}
  5. {{/* Otherwise, display first author if a profile for them exists. */}}
  6. {{ if and (not .Params.authors) (.Scratch.Get "superuser_username") }}
  7. {{ $author_page := site.GetPage (printf "/%s/%s" "authors" (.Scratch.Get "superuser_username")) }}
  8. {{ partial "page_author_card" (dict "author_page" $author_page) }}
  9. {{ else if .Params.authors }}
  10. {{ $taxonomy := "authors" }}
  11. {{ range $author_obj := (.GetTerms $taxonomy) }}
  12. {{ partial "page_author_card" (dict "author_page" $author_obj.Page) }}
  13. {{ end }}
  14. {{ end }}
  15. {{end}}{{/* Show profile block */}}