feat: allow overriding prev and next links in frontmatter (#15755) (#16044)

* feat: allow overriding prev and next links in frontmatter (#15755)

* build test successfully run locally

* implemented prev and next logic according to front matter

* added overriding prev and next in frontmatter

* cleaned code

* Update content/en/docs/ambient/install/_index.md

Co-authored-by: Craig Box <craig.box@gmail.com>

---------

Co-authored-by: Craig Box <craig.box@gmail.com>
This commit is contained in:
Adesh Ghadage 2025-01-13 23:58:51 +05:30 committed by GitHub
parent 3f4412e3f5
commit 6bcd8838a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 19 additions and 6 deletions

View File

@ -6,8 +6,9 @@ aliases:
- /docs/ops/ambient/getting-started - /docs/ops/ambient/getting-started
- /latest/docs/ops/ambient/getting-started - /latest/docs/ops/ambient/getting-started
owner: istio/wg-networking-maintainers owner: istio/wg-networking-maintainers
skip_list: true
test: yes 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). 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).

View File

@ -4,6 +4,7 @@ description: Delete Istio and associated resources.
weight: 6 weight: 6
owner: istio/wg-networking-maintainers owner: istio/wg-networking-maintainers
test: yes 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. If you no longer need Istio and associated resources, you can delete them by following the steps in this section.

View File

@ -4,6 +4,7 @@ description: Deploy the Bookinfo sample application.
weight: 2 weight: 2
owner: istio/wg-networking-maintainers owner: istio/wg-networking-maintainers
test: yes 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. To explore Istio, you will install the sample [Bookinfo application](/docs/examples/bookinfo/), composed of four separate microservices used to demonstrate various Istio features.

View File

@ -1,15 +1,25 @@
{{ $skipPageNav := .Scratch.Get "skipPageNav" }} {{ $skipPageNav := .Scratch.Get "skipPageNav" }}
{{ if not (or .Params.skip_pagenav $skipPageNav) }} {{ if not (or .Params.skip_pagenav $skipPageNav) }}
{{ if or .NextInSection .PrevInSection }} {{ $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 }}
<nav class="pagenav"> <nav class="pagenav">
<div class="left"> <div class="left">
{{ if .NextInSection }} {{ if $prev }}
<a title="{{ .NextInSection.Description }}" href="{{ .NextInSection.Permalink }}" class="next-link">{{- partial "icon.html" "left-arrow" -}}{{- .NextInSection.LinkTitle -}}</a> <a title="{{ $prev.Description }}" href="{{ $prev.Permalink }}" class="next-link">{{- partial "icon.html" "left-arrow" -}}{{- $prev.LinkTitle -}}</a>
{{ end }} {{ end }}
</div> </div>
<div class="right"> <div class="right">
{{ if .PrevInSection }} {{ if $next }}
<a title="{{ .PrevInSection.Description }}" href="{{ .PrevInSection.Permalink }}" class="next-link">{{- .PrevInSection.LinkTitle -}}{{- partial "icon.html" "right-arrow" -}}</a> <a title="{{ $next.Description }}" href="{{ $next.Permalink }}" class="next-link">{{- $next.LinkTitle -}}{{- partial "icon.html" "right-arrow" -}}</a>
{{ end }} {{ end }}
</div> </div>
</nav> </nav>