diff options
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> |
