You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ma...@apache.org on 2026/01/19 16:43:11 UTC
(flink) 02/06: [FLINK-38914][docs] Preserve page path when linking to stable version
This is an automated email from the ASF dual-hosted git repository.
martijnvisser pushed a commit to branch release-1.16
in repository https://gitbox.apache.org/repos/asf/flink.git
commit f9e08184343390801c35b31e200c78386016dde2
Author: Martijn Visser <29...@users.noreply.github.com>
AuthorDate: Mon Dec 29 13:08:42 2025 +0100
[FLINK-38914][docs] Preserve page path when linking to stable version
The "stable version" link in the warning banner for unreleased/out-of-date docs now redirects to the equivalent page in the stable docs instead of always redirecting to the homepage.
---
docs/layouts/partials/docs/inject/content-before.html | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/docs/layouts/partials/docs/inject/content-before.html b/docs/layouts/partials/docs/inject/content-before.html
index bfbea6ce7ab..35d7dde271f 100644
--- a/docs/layouts/partials/docs/inject/content-before.html
+++ b/docs/layouts/partials/docs/inject/content-before.html
@@ -20,16 +20,18 @@ under the License.
Partial that renders before the content on every page.
-->
{{ if $.Site.Params.ShowOutDatedWarning }}
+{{ $stableURL := replaceRE "/flink-docs-[^/]+/" "/flink-docs-stable/" .Permalink }}
<article class="markdown">
<blockquote style="border-color:#f66">
- {{ markdownify "This documentation is for an out-of-date version of Apache Flink. We recommend you use the latest [stable version](https://nightlies.apache.org/flink/flink-docs-stable/)."}}
+ {{ markdownify (printf "This documentation is for an out-of-date version of Apache Flink. We recommend you use the latest [stable version](%s)." $stableURL) }}
</blockquote>
</article>
{{ end }}
{{ if (not $.Site.Params.IsStable) }}
+{{ $stableURL := replaceRE "/flink-docs-[^/]+/" "/flink-docs-stable/" .Permalink }}
<article class="markdown">
<blockquote style="border-color:#f66">
- {{ markdownify "This documentation is for an unreleased version of Apache Flink. We recommend you use the latest [stable version](https://nightlies.apache.org/flink/flink-docs-stable/)."}}
+ {{ markdownify (printf "This documentation is for an unreleased version of Apache Flink. We recommend you use the latest [stable version](%s)." $stableURL) }}
</blockquote>
</article>
{{ end }}