From cbbacd5b5e9cb0d10c0f663352357c51d5355c5a Mon Sep 17 00:00:00 2001 From: Adam Ormsby Date: Sat, 30 Nov 2019 13:18:09 +0700 Subject: [PATCH] add panr mods --- layouts/_default/list.html | 28 ++++++++++++---------------- layouts/_default/single.html | 19 +++++++++---------- layouts/partials/lastmod.html | 7 +++++++ 3 files changed, 28 insertions(+), 26 deletions(-) create mode 100644 layouts/partials/lastmod.html diff --git a/layouts/_default/list.html b/layouts/_default/list.html index ae2912a..57d3988 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,14 +1,14 @@ {{ define "main" }} + {{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }} + {{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }} + + {{ $PageContext := . }} + {{ if .IsHome }} + {{ $PageContext = .Site }} + {{ end }} + {{ $paginator := .Paginate (where $PageContext.RegularPages "Type" $contentTypeName) }} +
- {{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }} - {{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }} - - {{ $PageContext := . }} - {{ if .IsHome }} - {{ $PageContext = .Site }} - {{ end }} - {{ $paginator := .Paginate (where $PageContext.RegularPages "Type" $contentTypeName) }} - {{ range $paginator.Pages }}

{{ .Title | markdownify }}

@@ -17,12 +17,9 @@ + {{ if $.Site.Params.LastModDisplay}} - {{ with .Lastmod }} - - {{ $.Site.Params.LastModDisplay }} {{ .Format ($.Site.Params.DateFormatSingle | default "2006-01-02") }} - - {{ end }} + {{ partial "lastmod.html" . }} {{ end }} {{ end }} {{ with .Params.Author }}{{ end }} @@ -31,7 +28,6 @@ {{ end }}
- {{ if .Params.tags }}
-{{ end }} +{{ end }} \ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 1173f71..5b4b80e 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,19 +1,18 @@ {{ define "main" }} + {{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }} + {{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }} +

{{ .Title | markdownify }}

-{{ end }} +{{ end }} \ No newline at end of file diff --git a/layouts/partials/lastmod.html b/layouts/partials/lastmod.html new file mode 100644 index 0000000..ff80115 --- /dev/null +++ b/layouts/partials/lastmod.html @@ -0,0 +1,7 @@ +{{ if gt .Lastmod .Date }} + {{ with .Lastmod }} + + ({{ $.Site.Params.LastModDisplay }} {{ .Format ($.Site.Params.DateFormatSingle | default "2006-01-02") }}) + + {{ end }} +{{ end }} \ No newline at end of file