From e253038e4d763f03b598956a296567a9cceb4cb8 Mon Sep 17 00:00:00 2001 From: Leon Mika Date: Mon, 29 Dec 2025 10:17:30 +1100 Subject: [PATCH 1/3] Added summary parameter --- layouts/shortcodes/postlist.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/layouts/shortcodes/postlist.html b/layouts/shortcodes/postlist.html index afa9f53..040402f 100644 --- a/layouts/shortcodes/postlist.html +++ b/layouts/shortcodes/postlist.html @@ -3,6 +3,7 @@ {{- $parOrder := or (and .Params (.Get "order")) "" -}} {{- $parLimit := or (and .Params (.Get "limit")) "" -}} {{- $parDisplay := or (and .Params (.Get "display")) "" -}} +{{- $parSummaries := or (and .Params (.Get "summaries")) "if-available" -}} {{- $pgr := where .Site.RegularPages "Section" "ne" "" -}} {{- $pgr = where $pgr "Section" "not in" (slice "replies") -}} @@ -45,7 +46,7 @@
{{ if .Title }}

{{ .Title }}

- {{ if .Params.custom_summary }} + {{ if and (ne $parSummaries "none") .Params.custom_summary }}

{{ .Summary | safeHTML }}

@@ -71,7 +72,7 @@ {{ range $pgr }} {{- if (ne .LinkTitle "") -}}
  • {{ .LinkTitle }}
  • - {{- else if (ne .Summary "") -}} + {{- else if and (ne $parSummaries "none") (ne .Summary "") -}}
  • {{ .Summary | safeHTML | truncate 70 }}
  • {{- else -}}
  • {{ .Content | safeHTML | truncate 70 }}
  • From e0746ea042dd9f9987c8df9ba0d849054b97c5cd Mon Sep 17 00:00:00 2001 From: Leon Mika Date: Mon, 29 Dec 2025 10:38:08 +1100 Subject: [PATCH 2/3] Switched to content-options --- layouts/shortcodes/postlist.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/layouts/shortcodes/postlist.html b/layouts/shortcodes/postlist.html index 040402f..12ca8f5 100644 --- a/layouts/shortcodes/postlist.html +++ b/layouts/shortcodes/postlist.html @@ -3,7 +3,7 @@ {{- $parOrder := or (and .Params (.Get "order")) "" -}} {{- $parLimit := or (and .Params (.Get "limit")) "" -}} {{- $parDisplay := or (and .Params (.Get "display")) "" -}} -{{- $parSummaries := or (and .Params (.Get "summaries")) "if-available" -}} +{{- $parContentOptions := split (or (and .Params (.Get "content-options")) "") " " -}} {{- $pgr := where .Site.RegularPages "Section" "ne" "" -}} {{- $pgr = where $pgr "Section" "not in" (slice "replies") -}} @@ -34,6 +34,8 @@ {{- $pgr = $pgr.Limit (int $parLimit) -}} {{- end -}} +{{- $showSummary := not (in $parContentOptions "no-summary") -}} + {{- if (eq $parDisplay "content") -}} {{ if templates.Exists "partials/_postlist/post-content-before.html" }} {{ partial "_postlist/post-content-before.html" $pgr }} @@ -46,7 +48,7 @@
    {{ if .Title }}

    {{ .Title }}

    - {{ if and (ne $parSummaries "none") .Params.custom_summary }} + {{ if and $showSummary .Params.custom_summary }}

    {{ .Summary | safeHTML }}

    @@ -72,7 +74,7 @@ {{ range $pgr }} {{- if (ne .LinkTitle "") -}}
  • {{ .LinkTitle }}
  • - {{- else if and (ne $parSummaries "none") (ne .Summary "") -}} + {{- else if and $showSummary (ne .Summary "") -}}
  • {{ .Summary | safeHTML | truncate 70 }}
  • {{- else -}}
  • {{ .Content | safeHTML | truncate 70 }}
  • From 216ab5a9570800a5484e1142e4a2a6fa59f06a4b Mon Sep 17 00:00:00 2001 From: Leon Mika Date: Mon, 29 Dec 2025 10:44:01 +1100 Subject: [PATCH 3/3] Bumped version number to 1.4.0 --- plugin.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.json b/plugin.json index f88bf11..e9dd31b 100644 --- a/plugin.json +++ b/plugin.json @@ -1,5 +1,5 @@ { - "version": "1.3.1", + "version": "1.4.0", "title": "Postlist", "description": "Shortcode for dynamically adding a list of posts", "includes": [