From 2ce906cb315abccda327f723ad9d8d1e03b1b2dc Mon Sep 17 00:00:00 2001 From: loikein Date: Tue, 25 Apr 2023 14:43:15 +0100 Subject: [PATCH] add paginator for home page; update social footers; change meta check logic --- layouts/index.html | 70 +++++++++++++++++++--------- layouts/partials/content.header.html | 8 +--- layouts/partials/footer.html | 24 +++++----- 3 files changed, 63 insertions(+), 39 deletions(-) diff --git a/layouts/index.html b/layouts/index.html index 622e814..9c07738 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,26 +1,54 @@ {{ define "main" }}
- {{ partial "brand.html" . }} - {{ with .Content }} -
- {{ . }} -
- {{ end }} -
- {{ range .Site.RegularPages }} - {{/* range where .Site.RegularPages "Type" "posts" */}} - {{ if ne .Draft true}} -

- {{ if .IsNode }} - {{ .Title}} - {{ else }} - {{ .Title }}{{ if .Draft }} :: Draft {{end}} - {{ end }} -

-

{{ truncate 140 .Summary }}

- {{ end }} - {{ end }} +{{ partial "brand.html" . }} +{{ with .Content }} +
+ {{ . }}
- {{ partial "footer.html" . }} +{{ end }} +
+{{ range (.Paginate .Site.RegularPages).Pages }} +{{/* range where .Site.RegularPages "Type" "posts" */}} +{{ if ne .Draft true}} +

+ {{ if .IsNode }} + {{ .Title}} + {{ else }} + {{ .Title }}{{ if .Draft }} :: Draft {{end}} + {{ end }} +

+ + {{ if .Description }} +

{{ .Description }}

+ {{ else }} +

{{ truncate 140 .Summary }}

+ {{ end }} + +{{ end }} +{{ end }} +
+ +{{ if and (.Paginator) (gt .Paginator.TotalPages 1) }} +
+ + +{{ if .Paginator.HasPrev }} +« +{{ end }} + + + +{{.Paginator.PageNumber}} / {{.Paginator.TotalPages}} + + + +{{ if .Paginator.HasNext }} +» +{{ end }} + + +{{ end }} + +{{ partial "footer.html" . }}
{{ end }} diff --git a/layouts/partials/content.header.html b/layouts/partials/content.header.html index 0557fa4..e20e82f 100644 --- a/layouts/partials/content.header.html +++ b/layouts/partials/content.header.html @@ -1,10 +1,6 @@

- {{- if .IsNode -}} - {{- .Title -}} - {{- else -}} - {{- .Title -}}{{- if .Draft -}} :: Draft {{- end -}} - {{- end -}} +{{- .Title -}}{{- if .Draft -}} :: Draft {{- end -}}

{{- if .IsPage -}} @@ -12,7 +8,7 @@

{{ .Params.subtitle }}

{{- end -}} - {{- if or (eq .Type "post") (.Params.meta) -}} + {{- if .Params.meta -}}