diff --git a/exampleSite/content/docs/getting-started.md b/exampleSite/content/docs/getting-started.md index e3e3526..fd4e5b3 100644 --- a/exampleSite/content/docs/getting-started.md +++ b/exampleSite/content/docs/getting-started.md @@ -1,6 +1,7 @@ --- title: Getting Started weight: 1 +next: /docs/guide --- ## Start as New Project diff --git a/exampleSite/content/docs/guide/_index.md b/exampleSite/content/docs/guide/_index.md index 76cb7f4..23b07cf 100644 --- a/exampleSite/content/docs/guide/_index.md +++ b/exampleSite/content/docs/guide/_index.md @@ -1,6 +1,7 @@ --- title: Guide weight: 2 +next: /docs/guide/organize-files sidebar: open: true --- diff --git a/layouts/docs/list.html b/layouts/docs/list.html index 78f6311..6bde8af 100644 --- a/layouts/docs/list.html +++ b/layouts/docs/list.html @@ -10,6 +10,7 @@ {{ .Content }}
+ {{ partial "components/last-updated.html" . }} {{ partial "components/pager.html" . }} diff --git a/layouts/partials/components/pager.html b/layouts/partials/components/pager.html index 6007fde..3f55281 100644 --- a/layouts/partials/components/pager.html +++ b/layouts/partials/components/pager.html @@ -1,15 +1,28 @@ {{/* Article navigation on the footer of the article */}} -{{ $reversePagination := .Scratch.Get "reversePagination" | default false }} +{{- $reversePagination := .Scratch.Get "reversePagination" | default false -}} {{- $prev := cond $reversePagination .PrevInSection .NextInSection -}} {{- $next := cond $reversePagination .NextInSection .PrevInSection -}} + +{{- with .Params.prev -}} + {{- with $.Site.GetPage . -}} + {{- if $reversePagination }}{{ $next = . }}{{ else }}{{ $prev = . }}{{ end -}} + {{- end -}} +{{- end -}} + +{{- with .Params.next -}} + {{- with $.Site.GetPage . -}} + {{- if $reversePagination }}{{ $prev = . }}{{ else }}{{ $next = . }}{{ end -}} + {{- end -}} +{{- end -}} + {{- if or $prev $next -}}
{{- if $prev -}} {{- partial "utils/icon.html" (dict "name" "chevron-right" "attributes" "class=\"inline h-5 shrink-0 ltr:rotate-180\"") -}} - {{- $prev.Title -}} + {{- $prev.LinkTitle -}} {{- end -}} {{- if $next -}}