From 4b24331134cf1795e4ca8e08f9e318e36b2b9dbb Mon Sep 17 00:00:00 2001 From: Dillon Date: Sun, 29 May 2022 22:27:36 +0800 Subject: [PATCH] feat: customize prev and next page link in the page footer --- layouts/partials/single/footer.html | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/layouts/partials/single/footer.html b/layouts/partials/single/footer.html index 2ef00d44..1ce50db9 100644 --- a/layouts/partials/single/footer.html +++ b/layouts/partials/single/footer.html @@ -62,11 +62,24 @@
- {{- if .PrevInSection -}} - + {{- $prevPage := false -}} + {{- $nextPage := false -}} + {{- if or (.Params.prev) (.Params.next) -}} + {{- with .Params.prev -}} + {{- $prevPage = $.Site.GetPage . -}} + {{- end -}} + {{- with .Params.next -}} + {{- $nextPage = $.Site.GetPage . -}} + {{- end -}} + {{- else -}} + {{- $prevPage = .PrevInSection -}} + {{- $nextPage = .NextInSection -}} {{- end -}} - {{ if .NextInSection }} - + {{- with $prevPage -}} + + {{- end -}} + {{ with $nextPage }} + {{- end -}}