diff options
Diffstat (limited to 'themes/default/layouts/partials/author-card.html')
-rw-r--r-- | themes/default/layouts/partials/author-card.html | 89 |
1 files changed, 45 insertions, 44 deletions
diff --git a/themes/default/layouts/partials/author-card.html b/themes/default/layouts/partials/author-card.html index bbb3ec8..561fef3 100644 --- a/themes/default/layouts/partials/author-card.html +++ b/themes/default/layouts/partials/author-card.html @@ -1,5 +1,5 @@ {{- $metadata := print "public/" .Data.user "/author.json" -}} -{{- $date := .Date.Local.Format "15:04 Jan 2 2006" -}} +{{- $date := .Date | time.Format "Mon Jan 2 2006" -}} {{- $host := (urls.Parse ("" | absURL)).Host -}} @@ -17,9 +17,11 @@ {{- $sourceset = print "/" (partial "function-paths.html").media "/" .Data.user "/" .Data.user "-profile.webp" -}} {{- with $metadata := resources.Get $metadata -}} - {{- $metadata = $metadata.Content | transform.Unmarshal -}} - {{- $width = $metadata.picture.profileWidth -}} - {{- $height = $metadata.picture.profileHeight -}} + {{- with $content := $metadata.Content -}} + {{- $metadata = $content | transform.Unmarshal -}} + {{- $width = $metadata.picture.profileWidth -}} + {{- $height = $metadata.picture.profileHeight -}} + {{- end -}} {{- end -}} {{- if or @@ -36,45 +38,44 @@ <micro-author> <micro-card> - <micro-summary> - <micro-thumbnail> - <figure> - <a title="{{ .Data.name }}" href="{{ "" | absURL }}/{{ .Data.user }}/#"> - <picture> - {{- with $sourceset -}} - <source srcset="{{ $sourceset }}" type="image/webp" /> - {{- end -}} - <img - width="{{ or $width "64" }}" - height="{{ or $height "64" }}" - src="{{ $source }}" - alt="{{ $alternate }}" - /> - </picture> - </a> - </figure> - </micro-thumbnail> - <micro-header> - <h2> - <b>{{ .Data.name }}</b> - </h2> - <h3> - <a data-hover title="{{ .Data.name }}" href="{{ "" | absURL }}/{{ .Data.user }}/#"> - {{ .Data.user }}@{{ $host }} - </a> - </h3> - <time - title="{{ .Date.Format "Monday, January 2 2006 at 15:04:05 MST" }}" - datetime="{{ .Date.Format "2006-01-02T15:04:05Z" }}" - > - {{ $date }} - </time> - </micro-header> - <p>{{ .Data.description | markdownify | plainify | htmlUnescape | truncate 60 "..." }}</p> - <a title="Follow with RSS Reader" href="{{ "" | absURL }}/{{ .Data.user }}/rss.xml"> - {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/rss.svg")) }} - <span>Follow</span> - </a> - </micro-summary> + <header> + <figure> + <a title="{{ .Data.name }}" href="{{ "" | absURL }}/{{ .Data.user }}/"> + <picture> + {{- with $sourceset -}} + <source srcset="{{ print ("" | absURL) $sourceset }}" type="image/webp" /> + {{- end -}} + <img + width="{{ or $width "64" }}" + height="{{ or $height "64" }}" + src="{{ print ("" | absURL) $source }}" + alt="{{ $alternate }}" + /> + </picture> + </a> + </figure> + </header> + <article> + <h2> + <b>{{ .Data.name }}</b> + </h2> + <h3> + <a data-hover="" title="{{ .Data.name }}" href="{{ "" | absURL }}/{{ .Data.user }}/"> + {{ .Data.user }}@{{ $host }} + </a> + </h3> + <time + data-type="default" + title="{{ .Date | time.Format "Monday January 2 2006 at 15:04:05 MST" }}" + datetime="{{ .Date | time.Format "2006-01-02T15:04:05Z" }}" + > + {{ $date }} + </time> + </article> + <p>{{ .Data.description | markdownify | plainify | htmlUnescape | truncate 60 "..." }}</p> + <a title="Follow with RSS Reader" href="{{ "" | absURL }}/{{ .Data.user }}/rss.xml"> + {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/tabler/rss.svg")) }} + <span>Feed</span> + </a> </micro-card> </micro-author> |