aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2023-02-15 23:18:25 -0500
committertdro <tdro@noreply.example.com>2023-02-15 23:18:25 -0500
commit8d5ad23f2b1a86fe99e03aa00b42eaca71d98195 (patch)
tree62cd68c9d60f0e1a83b8f89c1a7b528e8f57c652
parent5e56072e8bb7b942542e11fd4e9e08c3aa444138 (diff)
downloadcanory-8d5ad23f2b1a86fe99e03aa00b42eaca71d98195.tar.gz
canory-8d5ad23f2b1a86fe99e03aa00b42eaca71d98195.tar.bz2
canory-8d5ad23f2b1a86fe99e03aa00b42eaca71d98195.zip
themes/default/layouts/_default/single: Add older/newer post links
-rw-r--r--themes/default/layouts/_default/single.html33
1 files changed, 33 insertions, 0 deletions
diff --git a/themes/default/layouts/_default/single.html b/themes/default/layouts/_default/single.html
index bf077f9..4d5e172 100644
--- a/themes/default/layouts/_default/single.html
+++ b/themes/default/layouts/_default/single.html
@@ -21,6 +21,39 @@
<micro-thread>
{{ .Render "summary" }}
+ {{- $nextHref := "" -}}
+ {{- $prevHref := "" -}}
+ {{- $nextTitle := "" -}}
+ {{- $prevTitle := "" -}}
+ {{- $nextInvisible := "data-invisible" -}}
+ {{- $prevInvisible := "data-invisible" -}}
+
+ {{- with .Next -}}
+ {{- $nextHref = $.Next.Permalink -}}
+ {{- $nextTitle = $.Next.Summary -}}
+ {{- $nextInvisible = "" -}}
+ {{- end -}}
+
+ {{- with .Prev -}}
+ {{- $prevHref = $.Prev.Permalink -}}
+ {{- $prevTitle = $.Prev.Summary -}}
+ {{- $prevInvisible = "" -}}
+ {{- end -}}
+
+ {{- with or .Next .Prev -}}
+ <paginator-navigation>
+ <a {{ $nextInvisible | safeHTMLAttr }} href="{{ $nextHref }}" title="{{ $nextTitle }}">
+ {{ safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/arrow-left.svg")) }}
+ Newer
+ </a>
+
+ <a {{ $prevInvisible | safeHTMLAttr }} href="{{ $prevHref }}" title="{{ $prevTitle }}">
+ Older
+ {{ safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/arrow-right.svg")) }}
+ </a>
+ </paginator-navigation>
+ {{- end -}}
+
{{- $filteredPages := partial "function-filters-content.html" (.Site.RegularPages.Related .) -}}
{{- $related := $filteredPages | first 3 -}}