page_author.html 866 B

1234567891011121314151617181920
  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. {{ $author_urlized := "" }}
  7. {{ if and (not .Params.authors) (.Scratch.Get "superuser_username") }}
  8. {{ $author_urlized = (.Scratch.Get "superuser_username") }}
  9. {{ partial "page_author_card" (dict "username" $author_urlized) }}
  10. {{ else if .Params.authors }}
  11. {{ range $key, $tmp_username := .Params.authors }}
  12. {{ $author_urlized = urlize $tmp_username }}
  13. {{ partial "page_author_card" (dict "username" $author_urlized) }}
  14. {{ end }}
  15. {{ end }}
  16. {{end}}{{/* Show profile block */}}