hugo-theme/layouts/partials/block/author.html
2024-10-21 21:29:11 +02:00

24 lines
633 B
HTML

{{ $showAuthor := (.Params.showAuthor) | default .Site.Params.showAuthor }}
{{- if $showAuthor -}}
{{- $author := "" -}}
{{- if .Params.author -}}
{{- $author = .Params.author -}}
{{- else if and .Site.Params.Author .Site.Params.Author.name -}}
{{- $author = .Site.Params.Author.name -}}
{{- end -}}
{{- if $author -}}
<div class="flex flex-col gap-y-1 md:flex-row md:gap-y-0 md:gap-x-4 text-slate-500 dark:text-slate-300">
<div class="flex flex-row text-base gap-x-1">
<i class="h-6 w-6 flex-none">
{{ partial "icon.html" "user" }}
</i>
<span>{{ $author }}</span>
</div>
</div>
{{- end -}}
{{- end -}}