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 }} {{ range .Params.tags }} @@ -62,4 +58,4 @@ {{ end }} {{ partial "pagination.html" . }}
-{{ 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 }}

- {{ with .Date | default nil }} + {{ if .Date | default nil }} - {{ end }} - {{ if $.Site.Params.LastModDisplay}} - {{ if .Date }} - {{ with .Lastmod }} - - {{ $.Site.Params.LastModDisplay }} {{ .Format ($.Site.Params.DateFormatSingle | default "2006-01-02") }} - + {{ if eq .Type $contentTypeName }} + {{ if $.Site.Params.LastModDisplay}} + {{ partial "lastmod.html" . }} {{ end }} {{ end }} {{ end }} @@ -72,4 +71,4 @@ {{ partial "comments.html" . }}
-{{ 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