mirror of
https://github.com/gcushen/hugo-academic.git
synced 2025-07-23 10:00:52 +02:00
Update single.html to fix author formatting issues.
This commit is contained in:
parent
676a1b20ee
commit
c25021b9fb
1 changed files with 3 additions and 3 deletions
|
@ -29,18 +29,18 @@
|
|||
<div class="text-gray-500 dark:text-gray-300 text-sm flex items-center flex-wrap gap-y-2">
|
||||
{{- if .Date | and (not .Params.hide_date) -}}
|
||||
<span class="mr-1">{{- .Date | time.Format (site.Params.locale.date_format | default ":date_long") -}}</span>
|
||||
{{- if .Params.authors }}<span class="mx-1">·</span>{{ end -}}
|
||||
{{- if .Params.authors }}<span class="ml-1 mr-1">·</span>{{ end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{ $taxonomy := "authors" }}
|
||||
{{ range $i, $author_obj := (.GetTerms $taxonomy) }}
|
||||
{{ $author_page := $author_obj.Page }}
|
||||
{{ $avatar := ($author_page.Resources.ByType "image").GetMatch "*avatar*" }}
|
||||
{{- if and $i (not $avatar) }}<span class="mr-1">,</span>{{ end -}}
|
||||
{{ if ne $i 0}} <span class="mr-1">,</span>{{ end }}
|
||||
{{ with $author_page.Params.website }}
|
||||
<a href="{{.}}" target="_blank" rel="noreferrer">
|
||||
{{ end }}
|
||||
<div class="group inline-flex items-center text-current gap-x-1.5 mx-1">
|
||||
<div class="group inline-flex items-center text-current gap-x-1.5 ml-1">
|
||||
{{ with $avatar }}
|
||||
{{ $avatar = $avatar.Process "Fill 50x50 Center webp" }}
|
||||
<img src="{{ $avatar.RelPermalink }}" alt="{{ $author_page.Title }}" class="inline-block h-4 w-4 rounded-full border border-current" loading="lazy" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue