Compare commits

..

No commits in common. "main" and "v1.3.0" have entirely different histories.
main ... v1.3.0

2 changed files with 11 additions and 19 deletions

View file

@ -1,26 +1,18 @@
{{- $parCategories := or (and .Params (.Get "categories")) "" -}}
{{- $parTitleMatches := or (and .Params (.Get "title-matches")) "" -}}
{{- $parOrder := or (and .Params (.Get "order")) "" -}}
{{- $parLimit := or (and .Params (.Get "limit")) "" -}}
{{- $parDisplay := or (and .Params (.Get "display")) "" -}}
{{- $pgr := where .Site.RegularPages "Section" "ne" "" -}} {{- $pgr := where .Site.RegularPages "Section" "ne" "" -}}
{{- $pgr = where $pgr "Section" "not in" (slice "replies") -}} {{- $pgr = where $pgr "Section" "not in" (slice "replies") -}}
{{- if (.Get "categories") -}}
{{- if (ne $parCategories "") -}} {{- range (split (.Get "categories") ",") -}}
{{- range (split $parCategories ",") -}}
{{- $pgr = (where $pgr "Params.categories" "intersect" (slice .)) -}} {{- $pgr = (where $pgr "Params.categories" "intersect" (slice .)) -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{- if (.Get "title-matches") -}}
{{- if (ne $parTitleMatches "") -}} {{- $pgr = (where $pgr "Params.title" "like" (.Get "title-matches")) -}}
{{- $pgr = (where $pgr "Params.title" "like" $parTitleMatches) -}}
{{- end -}} {{- end -}}
{{- if (ne $parOrder "") -}} {{- if (ne (.Get "order") "") -}}
{{- $order := split $parOrder " " -}} {{- $order := split (.Get "order") " " -}}
{{- if (eq (index $order 0) "alpha" ) -}} {{- if (eq (index $order 0) "alpha" ) -}}
{{- $pgr = $pgr.ByTitle -}} {{- $pgr = $pgr.ByLinkTitle -}}
{{- else if (eq (index $order 0) "date" ) -}} {{- else if (eq (index $order 0) "date" ) -}}
{{- $pgr = $pgr.ByDate -}} {{- $pgr = $pgr.ByDate -}}
{{- end -}} {{- end -}}
@ -29,11 +21,11 @@
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{- if (ne $parLimit "") -}} {{- if (ne (.Get "limit") "") -}}
{{- $pgr = $pgr.Limit (int $parLimit) -}} {{- $pgr = $pgr.Limit (int (.Get "limit")) -}}
{{- end -}} {{- end -}}
{{- if (eq $parDisplay "content") -}} {{- if (eq (.Get "display") "content") -}}
{{ if templates.Exists "partials/_postlist/post-content-before.html" }} {{ if templates.Exists "partials/_postlist/post-content-before.html" }}
{{ partial "_postlist/post-content-before.html" $pgr }} {{ partial "_postlist/post-content-before.html" $pgr }}
{{ end }} {{ end }}

View file

@ -1,5 +1,5 @@
{ {
"version": "1.3.1", "version": "1.3.0",
"title": "Postlist", "title": "Postlist",
"description": "Shortcode for dynamically adding a list of posts", "description": "Shortcode for dynamically adding a list of posts",
"includes": [ "includes": [