This is an automated email from the ASF dual-hosted git repository. martijnvisser pushed a commit to branch release-1.18 in repository https://gitbox.apache.org/repos/asf/flink.git
commit 4fca9f3cef10468d7a3ed591d1a843c66102c476 Author: Martijn Visser <[email protected]> AuthorDate: Wed Jan 21 09:04:22 2026 +0100 [FLINK-38955][docs] Add canonical tag to generated Javadoc (cherry picked from commit 8226f3b8b0f2da1fd5ed9d12ca1036551d6e4229) --- .github/workflows/docs.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/docs.sh b/.github/workflows/docs.sh index 1c0a2f5b2fe..d3d32dd42c1 100755 --- a/.github/workflows/docs.sh +++ b/.github/workflows/docs.sh @@ -59,6 +59,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 mvn -pl flink-scala scala:doc -B \ -Dcheckstyle.skip=true \
