summaryrefslogtreecommitdiff
path: root/layouts/partials/list/post-card.html
diff options
context:
space:
mode:
authorArne Rief <riearn@proton.me>2025-12-22 14:02:07 +0100
committerArne Rief <riearn@proton.me>2025-12-22 14:02:07 +0100
commit038054b8206a9c25e84adeb0f0f355abd22d6143 (patch)
tree47700e52b88e0db08f0ca113de22f4c0d05cc405 /layouts/partials/list/post-card.html
parent32c1a5dd203435e8bef324306d1516e28ce14615 (diff)
CSS & JS splitting, small fix section badge
Diffstat (limited to 'layouts/partials/list/post-card.html')
-rw-r--r--layouts/partials/list/post-card.html17
1 files changed, 8 insertions, 9 deletions
diff --git a/layouts/partials/list/post-card.html b/layouts/partials/list/post-card.html
index b35c724..6444701 100644
--- a/layouts/partials/list/post-card.html
+++ b/layouts/partials/list/post-card.html
@@ -1,14 +1,14 @@
{{- /*
-Card with a summary of and link to a post. Accepts a dict with the following optional parameters:
+Card with a summary of and link to a post. Accepts a dict with the following parameters:
-@context {Page} post: The post to display (default: .).
-@context {bool} show_category: Whether to display a badge with the name of the category/section the post was published under (default: true).
+@context {Page} post: The post to display.
+@context {bool} show_section: Whether to display a badge with the name of the section the post was published under (default: false).
-@example: {{ partial "list/post-card.html" (dict "post" . "show_category" true) }}
+@example: {{ partial "list/post-card.html" (dict "post" . "show_section" true) }}
*/ -}}
-{{- $post := .post }}
-{{- $showCategory := .show_category | default false }}
+{{- $post := .post -}}
+{{- $showSection := .show_section | default false -}}
<article class="post-card">
<header class="post-card__header">
<h3 class="post-card__title">
@@ -31,10 +31,9 @@ Card with a summary of and link to a post. Accepts a dict with the following opt
</span>
</p>
-->
- {{- if $showCategory }}
- {{- $section := $post.Section }}
+ {{- if $showSection }}
<span class="post-card__section-badge">
- {{ lang.Translate ($section | singularize) | default ($section | singularize | title) }}
+ {{ lang.Translate ($post.Section | singularize) | default ($post.Section | singularize | title) }}
</span>
{{- end }}
</div>