From 32c1a5dd203435e8bef324306d1516e28ce14615 Mon Sep 17 00:00:00 2001 From: Arne Rief Date: Sat, 20 Dec 2025 20:03:23 +0100 Subject: Post-Card new design, improved styling for codeblocks & search --- layouts/partials/list/post-card.html | 23 +++++++++++++++++++---- layouts/partials/list/recent-posts.html | 2 +- 2 files changed, 20 insertions(+), 5 deletions(-) (limited to 'layouts/partials') diff --git a/layouts/partials/list/post-card.html b/layouts/partials/list/post-card.html index 955e868..b35c724 100644 --- a/layouts/partials/list/post-card.html +++ b/layouts/partials/list/post-card.html @@ -1,4 +1,14 @@ -{{- $post := . }} +{{- /* +Card with a summary of and link to a post. Accepts a dict with the following optional 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). + +@example: {{ partial "list/post-card.html" (dict "post" . "show_category" true) }} +*/ -}} + +{{- $post := .post }} +{{- $showCategory := .show_category | default false }}

@@ -13,14 +23,20 @@ + {{- if $showCategory }} + {{- $section := $post.Section }} + + {{ lang.Translate ($section | singularize) | default ($section | singularize | title) }} + + {{- end }}

@@ -47,6 +63,5 @@ {{- end }} -
{{- end }}
diff --git a/layouts/partials/list/recent-posts.html b/layouts/partials/list/recent-posts.html index 5426f70..f42af13 100644 --- a/layouts/partials/list/recent-posts.html +++ b/layouts/partials/list/recent-posts.html @@ -24,7 +24,7 @@ List of specified number of the most recent and published posts. Accepts a dict -- cgit v1.2.3