This is an automated email from the ASF dual-hosted git repository.

martijnvisser pushed a commit to branch release-1.20
in repository https://gitbox.apache.org/repos/asf/flink.git

commit 42c316e61e6ba3803123afc6b4031fd2e2afe7da
Author: Martijn Visser <[email protected]>
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.
    
    (cherry picked from commit 07902c9fea9c5c20e08419d4d8b6418f275faa61)
---
 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 }}

Reply via email to