From e70e6e9115a97bccb60dda38b2e3d3434d53c973 Mon Sep 17 00:00:00 2001 From: adesh_ghadage Date: Wed, 4 Dec 2024 22:32:51 +0530 Subject: [PATCH 1/5] feat: allow overriding prev and next links in frontmatter (#15755) --- layouts/partials/posts_navigation.html | 46 +++++++++++++++++--------- 1 file changed, 31 insertions(+), 15 deletions(-) diff --git a/layouts/partials/posts_navigation.html b/layouts/partials/posts_navigation.html index 1fbc7dde81481..fe4419d4999b7 100644 --- a/layouts/partials/posts_navigation.html +++ b/layouts/partials/posts_navigation.html @@ -1,17 +1,33 @@ {{ $skipPageNav := .Scratch.Get "skipPageNav" }} {{ if not (or .Params.skip_pagenav $skipPageNav) }} - {{ if or .NextInSection .PrevInSection }} - - {{ end }} -{{ end }} \ No newline at end of file + {{ $prev := .Params.prev | default (cond (or .Scratch.Get "reversePagination") .NextInSection .PrevInSection) }} + {{ $next := .Params.next | default (cond (or .Scratch.Get "reversePagination") .PrevInSection .NextInSection) }} + + {{ with $prev }} + {{ $prev = $.Site.GetPage . }} + {{ end }} + {{ with $next }} + {{ $next = $.Site.GetPage . }} + {{ end }} + + {{ if or $prev $next }} + + {{ end }} +{{ end }} From f1f46f2e32bb0597d2b4f50bbc1251184c42f640 Mon Sep 17 00:00:00 2001 From: adesh_ghadage Date: Thu, 5 Dec 2024 17:40:52 +0530 Subject: [PATCH 2/5] build test successfully run locally --- layouts/partials/posts_navigation.html | 39 +++++++++++--------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/layouts/partials/posts_navigation.html b/layouts/partials/posts_navigation.html index fe4419d4999b7..f7327d97f62b9 100644 --- a/layouts/partials/posts_navigation.html +++ b/layouts/partials/posts_navigation.html @@ -1,7 +1,8 @@ {{ $skipPageNav := .Scratch.Get "skipPageNav" }} {{ if not (or .Params.skip_pagenav $skipPageNav) }} - {{ $prev := .Params.prev | default (cond (or .Scratch.Get "reversePagination") .NextInSection .PrevInSection) }} - {{ $next := .Params.next | default (cond (or .Scratch.Get "reversePagination") .PrevInSection .NextInSection) }} + {{- $reversePagination := .Scratch.Get "reversePagination" | default false -}} + {{- $prev := cond $reversePagination .Params.next .Params.prev -}} + {{- $next := cond $reversePagination .Params.prev .Params.next -}} {{ with $prev }} {{ $prev = $.Site.GetPage . }} @@ -10,24 +11,18 @@ {{ $next = $.Site.GetPage . }} {{ end }} - {{ if or $prev $next }} - - {{ end }} + {{- if or $prev $next -}} + + {{- end -}} {{ end }} From 464e0b88868f5ef0bd09c72097f450ac88ee2301 Mon Sep 17 00:00:00 2001 From: adesh_ghadage Date: Fri, 6 Dec 2024 22:29:54 +0530 Subject: [PATCH 3/5] implemented prev and next logic according to front matter --- layouts/partials/posts_navigation.html | 45 ++++++++++++-------------- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/layouts/partials/posts_navigation.html b/layouts/partials/posts_navigation.html index f7327d97f62b9..83ff43e99fc4b 100644 --- a/layouts/partials/posts_navigation.html +++ b/layouts/partials/posts_navigation.html @@ -1,28 +1,25 @@ {{ $skipPageNav := .Scratch.Get "skipPageNav" }} {{ if not (or .Params.skip_pagenav $skipPageNav) }} - {{- $reversePagination := .Scratch.Get "reversePagination" | default false -}} - {{- $prev := cond $reversePagination .Params.next .Params.prev -}} - {{- $next := cond $reversePagination .Params.prev .Params.next -}} - - {{ with $prev }} - {{ $prev = $.Site.GetPage . }} - {{ end }} - {{ with $next }} - {{ $next = $.Site.GetPage . }} - {{ end }} - - {{- if or $prev $next -}} - - {{- end -}} -{{ end }} + {{ if or $prev $next }} + + {{ end }} +{{ end }} \ No newline at end of file From 9b607c5d5a9bade4baa95eaa601ce93dc0d2b968 Mon Sep 17 00:00:00 2001 From: adesh_ghadage Date: Thu, 12 Dec 2024 23:28:50 +0530 Subject: [PATCH 4/5] added overriding prev and next in frontmatter --- .../en/docs/ambient/getting-started/_index.md | 3 ++- .../ambient/getting-started/cleanup/index.md | 1 + .../getting-started/deploy-sample-app/index.md | 1 + content/en/docs/ambient/install/_index.md | 1 + layouts/partials/posts_navigation.html | 16 +++++++++------- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/content/en/docs/ambient/getting-started/_index.md b/content/en/docs/ambient/getting-started/_index.md index 8829b8592b502..889a9bca31e2d 100644 --- a/content/en/docs/ambient/getting-started/_index.md +++ b/content/en/docs/ambient/getting-started/_index.md @@ -6,8 +6,9 @@ aliases: - /docs/ops/ambient/getting-started - /latest/docs/ops/ambient/getting-started owner: istio/wg-networking-maintainers -skip_list: true test: yes +skip_list: true +next: /docs/ambient/getting-started/deploy-sample-app --- This guide lets you quickly evaluate Istio's {{< gloss "ambient" >}}ambient mode{{< /gloss >}}. You'll need a Kubernetes cluster to proceed. If you don't have a cluster, you can use [kind](/docs/setup/platform-setup/kind) or any other [supported Kubernetes platform](/docs/setup/platform-setup). diff --git a/content/en/docs/ambient/getting-started/cleanup/index.md b/content/en/docs/ambient/getting-started/cleanup/index.md index 640e203c629a5..7e5a0b0c54e1a 100644 --- a/content/en/docs/ambient/getting-started/cleanup/index.md +++ b/content/en/docs/ambient/getting-started/cleanup/index.md @@ -4,6 +4,7 @@ description: Delete Istio and associated resources. weight: 6 owner: istio/wg-networking-maintainers test: yes +next: /docs/ambient/install --- If you no longer need Istio and associated resources, you can delete them by following the steps in this section. diff --git a/content/en/docs/ambient/getting-started/deploy-sample-app/index.md b/content/en/docs/ambient/getting-started/deploy-sample-app/index.md index 60ed499b68e36..a01e80055245a 100644 --- a/content/en/docs/ambient/getting-started/deploy-sample-app/index.md +++ b/content/en/docs/ambient/getting-started/deploy-sample-app/index.md @@ -4,6 +4,7 @@ description: Deploy the Bookinfo sample application. weight: 2 owner: istio/wg-networking-maintainers test: yes +prev: /docs/ambient/getting-started --- To explore Istio, you will install the sample [Bookinfo application](/docs/examples/bookinfo/), composed of four separate microservices used to demonstrate various Istio features. diff --git a/content/en/docs/ambient/install/_index.md b/content/en/docs/ambient/install/_index.md index bf75507d29733..062a8b0d17236 100644 --- a/content/en/docs/ambient/install/_index.md +++ b/content/en/docs/ambient/install/_index.md @@ -8,6 +8,7 @@ aliases: owner: istio/wg-environment-maintainers test: n/a list_below: yes +prev: /docs/ambient/getting-started/cleanup --- {{< tip >}} diff --git a/layouts/partials/posts_navigation.html b/layouts/partials/posts_navigation.html index 83ff43e99fc4b..501d6391bb1b1 100644 --- a/layouts/partials/posts_navigation.html +++ b/layouts/partials/posts_navigation.html @@ -1,13 +1,15 @@ {{ $skipPageNav := .Scratch.Get "skipPageNav" }} {{ if not (or .Params.skip_pagenav $skipPageNav) }} - {{$prev := .PrevInSection}} - {{$next := .NextInSection}} - {{ with .Params.prevInSection }} - {{$prev = .}} - {{ end }} - {{ with .Params.nextInSection }} - {{$next = .}} + {{ $prev := .NextInSection }} + {{ $next := .PrevInSection }} + {{ with .Params.prev }} + {{$prev = $.Site.GetPage $.Site.Language.Lang .}} {{ end }} + + {{- with .Params.next -}} + {{$next = $.Site.GetPage $.Site.Language.Lang .}} + {{- end -}} + {{ if or $prev $next }}