diff options
| author | Arne Rief <riearn@proton.me> | 2025-08-16 22:42:03 +0200 |
|---|---|---|
| committer | Arne Rief <riearn@proton.me> | 2025-08-16 22:42:03 +0200 |
| commit | f0506acd6f70da636b8fdb23439c85bbf2392b40 (patch) | |
| tree | d9c4082aafa3e20a37174beecadcab54286f9cd9 /layouts/partials/list/post-card.html | |
| parent | 1bf4d8aca6f81f2dddd0262e74b278cd9985b53d (diff) | |
HTML templates done
Diffstat (limited to 'layouts/partials/list/post-card.html')
| -rw-r--r-- | layouts/partials/list/post-card.html | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/layouts/partials/list/post-card.html b/layouts/partials/list/post-card.html new file mode 100644 index 0000000..12eada4 --- /dev/null +++ b/layouts/partials/list/post-card.html @@ -0,0 +1,45 @@ +{{- $post := . }} +<article class="post-card"> + <header class="post-card__header"> + <h3 class="post-card__title"> + <a href="{{ $post.RelPermalink }}" class="post-card__link"> + {{ $post.Title }} + </a> + </h3> + <div class="post-card__meta"> + <time datetime="{{ $post.Date.Format "2006-01-02T15:04:05Z07:00" }}" class="post-card__date"> + {{ $post.Date | time.Format ":date_medium" }} + </time> + {{- with $post.ReadingTime }} + <p class="post-card__reading-time"> + {{ lang.Translate "list.reading_time" . | default (printf "Estimated reading time: %s min" .) }} + </p> + {{- end }} + </div> + </header> + + {{- with $post.Summary }} + <div class="post-card__summary"> + {{ . }} + </div> + {{- end }} + + {{- with $post.Params.tags }} + <footer class="post-card__tags"> + <ul class="post-card__tags-list"> + {{- range first 3 . }} + <li class="post-card__tags-item"> + #{{ . }} + </li> + {{- end }} + {{- if gt (len .) 3 }} + <li class="post-card__tags-item post-card__tags-more"> + <span class="post-card__tags-more-count"> + +{{ sub (len .) 3 }} {{ lang.Translate "common.more" | default "more" }} + </span> + </li> + {{- end }} + </ul> + </footer> + {{- end }} +</article> |
