From 79e4f94a6c74b190d6f3f09c45b70bc7acb0e24a Mon Sep 17 00:00:00 2001 From: Leon Mika Date: Sun, 6 Jul 2025 09:37:09 +1000 Subject: [PATCH 1/7] Added limit option and display option --- .gitignore | 1 + layouts/partials/_postlist/post-content.html | 18 +++++++++++ layouts/shortcodes/postlist.html | 32 ++++++++++++++------ 3 files changed, 41 insertions(+), 10 deletions(-) create mode 100644 .gitignore create mode 100644 layouts/partials/_postlist/post-content.html diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/layouts/partials/_postlist/post-content.html b/layouts/partials/_postlist/post-content.html new file mode 100644 index 0000000..e7a702e --- /dev/null +++ b/layouts/partials/_postlist/post-content.html @@ -0,0 +1,18 @@ +
+{{ if .Title }} +

{{ .Title }}

+ {{ if .Params.custom_summary }} +
+

{{ .Summary | safeHTML }}

+

+ {{ else }} +
+ {{ .Content }} +
+ {{ end }} +{{ else }} +
+ {{ .Content }} +
+{{ end }} +
\ No newline at end of file diff --git a/layouts/shortcodes/postlist.html b/layouts/shortcodes/postlist.html index ad372b1..d191a31 100644 --- a/layouts/shortcodes/postlist.html +++ b/layouts/shortcodes/postlist.html @@ -18,14 +18,26 @@ {{- end -}} {{- end -}} - \ No newline at end of file + +{{- end -}} \ No newline at end of file From 0c1054e20fafce92242f2b9a78aa2b93c5e5c2b4 Mon Sep 17 00:00:00 2001 From: Leon Mika Date: Sun, 6 Jul 2025 09:39:08 +1000 Subject: [PATCH 2/7] Fixed invalid character --- layouts/shortcodes/postlist.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/shortcodes/postlist.html b/layouts/shortcodes/postlist.html index d191a31..804b850 100644 --- a/layouts/shortcodes/postlist.html +++ b/layouts/shortcodes/postlist.html @@ -35,7 +35,7 @@
  • {{ .LinkTitle }}
  • {{- else if (ne .Summary "") -}}
  • {{ .Summary | safeHTML | truncate 70 }}
  • - {{- e\lse -}} + {{- else -}}
  • {{ .Content | safeHTML | truncate 70 }}
  • {{ end }} {{ end }} From 7168f63e77a1ecfecc2c8d06fd88e522e7261d4a Mon Sep 17 00:00:00 2001 From: Leon Mika Date: Sun, 6 Jul 2025 09:54:20 +1000 Subject: [PATCH 3/7] Added before and after micro-hooks for post content --- layouts/shortcodes/postlist.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/layouts/shortcodes/postlist.html b/layouts/shortcodes/postlist.html index 804b850..7dc49d2 100644 --- a/layouts/shortcodes/postlist.html +++ b/layouts/shortcodes/postlist.html @@ -23,11 +23,17 @@ {{- end -}} {{- if (eq (.Get "display") "content") -}} + {{ if templates.Exists "partials/_postlist/post-content-before.html" }} + {{ partial "partials/_postlist/post-content-before.html" . }} + {{ end }}
    {{ range $pgr }} {{ partial "_postlist/post-content.html" . }} {{ end }}
    + {{ if templates.Exists "partials/_postlist/post-content-after.html" }} + {{ partial "partials/_postlist/post-content-after.html" . }} + {{ end }} {{- else -}}
      {{ range $pgr }} From 76675a789747b58153acb51cf60f268034b8546c Mon Sep 17 00:00:00 2001 From: Leon Mika Date: Sun, 6 Jul 2025 09:59:36 +1000 Subject: [PATCH 4/7] Fixed before and after templates to accept the page list --- layouts/shortcodes/postlist.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/layouts/shortcodes/postlist.html b/layouts/shortcodes/postlist.html index 7dc49d2..46c69f7 100644 --- a/layouts/shortcodes/postlist.html +++ b/layouts/shortcodes/postlist.html @@ -24,7 +24,7 @@ {{- if (eq (.Get "display") "content") -}} {{ if templates.Exists "partials/_postlist/post-content-before.html" }} - {{ partial "partials/_postlist/post-content-before.html" . }} + {{ partial "partials/_postlist/post-content-before.html" $pgr }} {{ end }}
      {{ range $pgr }} @@ -32,8 +32,8 @@ {{ end }}
      {{ if templates.Exists "partials/_postlist/post-content-after.html" }} - {{ partial "partials/_postlist/post-content-after.html" . }} - {{ end }} + {{ partial "partials/_postlist/post-content-after.html" $pgr }} + {{ end }} {{- else -}}
        {{ range $pgr }} From 7a843af74ac3b7adac44743087a2b24faedb46f1 Mon Sep 17 00:00:00 2001 From: Leon Mika Date: Sun, 6 Jul 2025 10:20:35 +1000 Subject: [PATCH 5/7] Removed embedded post content template --- layouts/partials/_postlist/post-content.html | 18 ------------- layouts/shortcodes/postlist.html | 27 +++++++++++++++++--- 2 files changed, 24 insertions(+), 21 deletions(-) delete mode 100644 layouts/partials/_postlist/post-content.html diff --git a/layouts/partials/_postlist/post-content.html b/layouts/partials/_postlist/post-content.html deleted file mode 100644 index e7a702e..0000000 --- a/layouts/partials/_postlist/post-content.html +++ /dev/null @@ -1,18 +0,0 @@ -
        -{{ if .Title }} -

        {{ .Title }}

        - {{ if .Params.custom_summary }} -
        -

        {{ .Summary | safeHTML }}

        -

        - {{ else }} -
        - {{ .Content }} -
        - {{ end }} -{{ else }} -
        - {{ .Content }} -
        -{{ end }} -
        \ No newline at end of file diff --git a/layouts/shortcodes/postlist.html b/layouts/shortcodes/postlist.html index 46c69f7..6b8db5a 100644 --- a/layouts/shortcodes/postlist.html +++ b/layouts/shortcodes/postlist.html @@ -24,15 +24,36 @@ {{- if (eq (.Get "display") "content") -}} {{ if templates.Exists "partials/_postlist/post-content-before.html" }} - {{ partial "partials/_postlist/post-content-before.html" $pgr }} + {{ partial "_postlist/post-content-before.html" $pgr }} {{ end }}
        {{ range $pgr }} - {{ partial "_postlist/post-content.html" . }} + {{ if templates.Exists "partials/_postlist/post-content.html" }} + {{ partial "_postlist/post-content.html" $pgr }} + {{ else }} +
        + {{ if .Title }} +

        {{ .Title }}

        + {{ if .Params.custom_summary }} +
        +

        {{ .Summary | safeHTML }}

        +

        + {{ else }} +
        + {{ .Content }} +
        + {{ end }} + {{ else }} +
        + {{ .Content }} +
        + {{ end }} +
        + {{ end }} {{ end }}
        {{ if templates.Exists "partials/_postlist/post-content-after.html" }} - {{ partial "partials/_postlist/post-content-after.html" $pgr }} + {{ partial "_postlist/post-content-after.html" $pgr }} {{ end }} {{- else -}}
          From ce7ec1e72a67d5e230aa63a7a5fe646aec29da50 Mon Sep 17 00:00:00 2001 From: Leon Mika Date: Sun, 6 Jul 2025 10:23:06 +1000 Subject: [PATCH 6/7] Fixed argument to post-content --- layouts/shortcodes/postlist.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/shortcodes/postlist.html b/layouts/shortcodes/postlist.html index 6b8db5a..b26e6e1 100644 --- a/layouts/shortcodes/postlist.html +++ b/layouts/shortcodes/postlist.html @@ -29,7 +29,7 @@
          {{ range $pgr }} {{ if templates.Exists "partials/_postlist/post-content.html" }} - {{ partial "_postlist/post-content.html" $pgr }} + {{ partial "_postlist/post-content.html" . }} {{ else }}
          {{ if .Title }} From ea5168b7a2347bda86cd121ccb6b2aee613039c8 Mon Sep 17 00:00:00 2001 From: Leon Mika Date: Sun, 6 Jul 2025 11:05:02 +1000 Subject: [PATCH 7/7] Bumped version to 1.2.0 --- plugin.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.json b/plugin.json index 168cf6f..f1dd227 100644 --- a/plugin.json +++ b/plugin.json @@ -1,5 +1,5 @@ { - "version": "1.1.0", + "version": "1.2.0", "title": "Postlist", "description": "Shortcode for dynamically adding a list of posts", "includes": [