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/21 10:25:59 UTC

(flink) 02/04: [FLINK-38955][docs] Add canonical tag to generated Javadoc

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

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

commit 8226f3b8b0f2da1fd5ed9d12ca1036551d6e4229
Author: Martijn Visser <29...@users.noreply.github.com>
AuthorDate: Wed Jan 21 09:04:22 2026 +0100

    [FLINK-38955][docs] Add canonical tag to generated Javadoc
---
 .github/workflows/docs.sh | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/.github/workflows/docs.sh b/.github/workflows/docs.sh
index 26709a7c465..a1d4c583336 100755
--- a/.github/workflows/docs.sh
+++ b/.github/workflows/docs.sh
@@ -73,6 +73,15 @@ mvn javadoc:aggregate -B \
     -Dspotless.check.skip=true \
     -Denforcer.skip=true \
     -Dheader="<a href=\"http://flink.apache.org/\" target=\"_top\"><h1>Back to Flink Website</h1></a> <script>var _paq=window._paq=window._paq||[];_paq.push([\"disableCookies\"]),_paq.push([\"setDomains\",[\"*.flink.apache.org\",\"*.nightlies.apache.org/flink\"]]),_paq.push([\"trackPageView\"]),_paq.push([\"enableLinkTracking\"]),function(){var u=\"//analytics.apache.org/\";_paq.push([\"setTrackerUrl\",u+\"matomo.php\"]),_paq.push([\"setSiteId\",\"1\"]);var d=document, g=d.createElement( [...]
+
+# Inject canonical tags into Javadoc HTML files to point to stable docs version
+CANONICAL_BASE="https://nightlies.apache.org/flink/flink-docs-stable/api/java"
+find target/site/apidocs -name "*.html" -type f | while read -r file; do
+    REL_PATH="${file#target/site/apidocs/}"
+    CANONICAL_URL="${CANONICAL_BASE}/${REL_PATH}"
+    sed -i "s|<head>|<head>\n<link rel=\"canonical\" href=\"${CANONICAL_URL}\">|" "$file"
+done
+
 mv target/site/apidocs docs/target/api/java
 
 # build python docs