mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-13 22:15:11 +00:00
26 lines
774 B
HTML
26 lines
774 B
HTML
{{/* Author profile box */}}
|
|
|
|
{{/* Don't show author box on normal pages or if author box disabled. */}}
|
|
{{ if ne .Type "page" | and (not (or (eq site.Params.profile false) (eq .Params.profile false))) }}
|
|
|
|
{{ $authors := .Params.authors }}
|
|
|
|
{{/* If authors not set, fallback to superuser/owner from Scratch */}}
|
|
{{ if (not $authors) }}
|
|
{{ $superuser := .Scratch.Get "superuser_slug" }}
|
|
{{ if $superuser }}
|
|
{{ $authors = (slice $superuser) }}
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{ if $authors }}
|
|
{{ range $idx, $slug := $authors }}
|
|
{{ $profile := partial "functions/get_author_profile" $slug }}
|
|
{{ if $profile.has_data }}
|
|
{{ partial "page_author_card" (dict "profile" $profile "page" .) }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{end}}{{/* Show profile block */}}
|