Compare commits

..

No commits in common. "1f3a89a05a438f0c14251037bb7d054f92aaddfb" and "ea5168b7a2347bda86cd121ccb6b2aee613039c8" have entirely different histories.

2 changed files with 9 additions and 20 deletions

View file

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

View file

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