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

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

commit 28bda0b99a414f6cfc2cd9f41ef9b70193fcfb60
Author: Martijn Visser <[email protected]>
AuthorDate: Wed Jan 14 14:42:50 2026 +0100

    [FLINK-38914][docs] Add canonical tags pointing to stable docs
    
    All documentation pages now include a canonical link tag pointing to the 
stable version (flink-docs-stable). This prevents search engines from indexing 
duplicate content across master, release, and stable versions, consolidating 
SEO value on the stable docs where users should land.
---
 docs/layouts/partials/docs/inject/head.html | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/docs/layouts/partials/docs/inject/head.html 
b/docs/layouts/partials/docs/inject/head.html
index f456c36bdc2..822b64ae3f3 100644
--- a/docs/layouts/partials/docs/inject/head.html
+++ b/docs/layouts/partials/docs/inject/head.html
@@ -19,6 +19,16 @@ under the License.
 <!--
     Misc other content that should run in the header
 -->
+<!-- Canonical URL pointing to stable docs to avoid duplicate content issues 
across versions -->
+{{- $basePath := (urls.Parse .Site.BaseURL).Path -}}
+{{- $pagePath := strings.TrimPrefix $basePath .RelPermalink -}}
+{{- if eq $pagePath "" -}}
+  {{- $pagePath = "/" -}}
+{{- else if not (hasPrefix $pagePath "/") -}}
+  {{- $pagePath = printf "/%s" $pagePath -}}
+{{- end -}}
+<link rel="canonical" 
href="https://nightlies.apache.org/flink/flink-docs-stable{{ $pagePath }}" />
+
 <link rel="stylesheet" type="text/css" 
href="{{.Site.BaseURL}}/font-awesome/css/font-awesome.min.css">
 <script src="{{.Site.BaseURL}}/js/anchor.min.js"></script>
 <script src="{{.Site.BaseURL}}/js/flink.js"></script>

Reply via email to