aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOscar Najera <hi@oscarnajera.com>2024-12-27 04:18:35 +0100
committerOscar Najera <hi@oscarnajera.com>2024-12-27 21:59:26 +0100
commitdad1ec93fd352da185ef6f431588250af1d48ec5 (patch)
tree7bba8da37d5a64eb53657e18f1413cd4f927bd00
parentedf690072e871a3e6acd84b8e9fb84483fdebdc2 (diff)
downloadhugo-minimalist-theme-dad1ec93fd352da185ef6f431588250af1d48ec5.tar.gz
hugo-minimalist-theme-dad1ec93fd352da185ef6f431588250af1d48ec5.tar.bz2
hugo-minimalist-theme-dad1ec93fd352da185ef6f431588250af1d48ec5.zip
Author card at post end
-rw-r--r--layouts/_default/single.html10
-rw-r--r--layouts/partials/author_card.html10
2 files changed, 12 insertions, 8 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 57010cc..cad6a35 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -25,7 +25,15 @@
{{ end }}
<div class="f5 f4-ns lh-copy pv2">
{{ if in (slice "post" "talk") .Section }}
- {{ partial "author_card" .Site.Params.Author }}
+ {{ range .Params.authors }}
+ {{ $name := . }}
+ {{ $path := printf "/%s/%s" "authors" ( $name | urlize ) }}
+ {{ with $.GetPage $path }}
+ {{ if .File }}
+ {{ partial "author_card" (merge .Params (dict "path" $path )) }}
+ {{ end }}
+ {{ end }}
+ {{ end }}
{{ end }}
{{ partial "post_pager" . }}
</div>
diff --git a/layouts/partials/author_card.html b/layouts/partials/author_card.html
index c2bbeab..e74ee98 100644
--- a/layouts/partials/author_card.html
+++ b/layouts/partials/author_card.html
@@ -3,14 +3,10 @@
<img src="{{ .avatar }}" class="br-100 w3" alt="{{ .name }}" />
</div>
<div class="w-90-ns ph3-ns">
- <h5 class="f4 mv1 berkshire-swash">
- {{ with .homepage }}
- <a href="{{ . }}" class="link color-inherit">
- {{ $.name }}
- </a>
- {{ else }}
+ <h5 class="f4 mv0 berkshire-swash">
+ <a href="{{ (default .path .homepage) }}" class="link color-inherit">
{{ .name }}
- {{ end }}
+ </a>
</h5>
<h6 class="f5 fw3 pa0 ma0">{{ .role | markdownify }}</h6>
<p class="f6 lh-copy">