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

tballison pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tika.git


The following commit(s) were added to refs/heads/main by this push:
     new e68fdf455a fix publish-docs (#3418)
e68fdf455a is described below

commit e68fdf455a2fd3aa3d5449e1cd8a47221a144684
Author: Tim Allison <[email protected]>
AuthorDate: Sun Oct 25 11:54:19 2026 -0400

    fix publish-docs (#3418)
---
 docs/publish-docs.sh | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/docs/publish-docs.sh b/docs/publish-docs.sh
index 8657204840..0263312ac9 100755
--- a/docs/publish-docs.sh
+++ b/docs/publish-docs.sh
@@ -83,6 +83,17 @@ mkdir -p "${DOCS_DIR}"
 
 # Strip the 'tika/' component dir prefix so URLs are /docs/X.Y.Z/...
 cp -r target/site/tika/* "${DOCS_DIR}/"
+# Canonical links are absolute (site.url + /tika/...), so the copy above 
doesn't
+# flatten them. Rewrite only the <link> tag: page prose may quote /docs/tika/.
+CANONICAL_TIKA='<link rel="canonical" href="https://tika.apache.org/docs/tika/'
+{ grep -rlF --include='*.html' "${CANONICAL_TIKA}" "${DOCS_DIR}" || true; } | 
while IFS= read -r page; do
+    sed_atomic 's|<link rel="canonical" 
href="https://tika.apache.org/docs/tika/|<link rel="canonical" 
href="https://tika.apache.org/docs/|' \
+        "${page}" "${page}"
+done
+if grep -rqF --include='*.html' "${CANONICAL_TIKA}" "${DOCS_DIR}"; then
+    echo "Unflattened canonical links remain under ${DOCS_DIR}." >&2
+    exit 1
+fi
 # UI assets one level above docs/, since HTML uses ../../_/ relative paths.
 # Replace wholesale: cp -r into an existing directory nests source as a
 # subdirectory (publish/_/_/), so remove first to keep the layout flat.

Reply via email to