Skip to content

Site: Resolve both latest version (/docs/1.11.0/) and its alias (/docs/latest/)#16497

Open
kevinjqliu wants to merge 5 commits into
apache:mainfrom
kevinjqliu:kevinjqliu/fix-site-version-alias-followup
Open

Site: Resolve both latest version (/docs/1.11.0/) and its alias (/docs/latest/)#16497
kevinjqliu wants to merge 5 commits into
apache:mainfrom
kevinjqliu:kevinjqliu/fix-site-version-alias-followup

Conversation

@kevinjqliu
Copy link
Copy Markdown
Contributor

@kevinjqliu kevinjqliu commented May 21, 2026

Description

Follow-up to #16496. The previous solution used a hook to create docs/1.11.0/ as a symlink to docs/latest/. That worked locally with mkdocs serve but failed in production: ghp-import does not preserve symlinks, so the version directory never makes it onto asf-site (see https://github.com/apache/iceberg/tree/asf-site/docslatest and older versions are present, but 1.11.0 is not).

This PR builds the current release directly into docs/<icebergVersion>/ and copies it to docs/latest/ post-build, so both URLs publish as static files. The copy is done in a post-build hook (rather than by adding 1.11.0 to nav.yml) so the sidebar shows only one entry for the latest release.

The search index is also restricted to the current release. The previous exclude-search configuration keyed on docs/latest/*, which no longer matches now that the canonical directory is docs/<icebergVersion>/.

Testing

In site/:

make clean
make serve-dev

tested the following:

@github-actions github-actions Bot added the docs label May 21, 2026
@kevinjqliu kevinjqliu marked this pull request as draft May 21, 2026 03:18
@kevinjqliu kevinjqliu changed the title Site: Fix version URL alias to use hard links instead of symlinks Site: Fix version URL alias for static hosting May 21, 2026
@kevinjqliu kevinjqliu marked this pull request as ready for review May 21, 2026 15:44
Comment thread site/hooks/version_alias.py Outdated
Creates a symlink so that /docs/<icebergVersion>/ resolves to /docs/latest/.
This allows version-specific URLs (e.g. /docs/1.11.0/) to work without
duplicating the navigation entry for the latest version.
Creates docs/<icebergVersion>/ from the built docs/latest/ output so that the
Copy link
Copy Markdown
Contributor

@stevenzwu stevenzwu May 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel it should be the other way. first, deploy to the version folder. second, add a link from latest to the version folder.

also can symlink work without copying the tree? <-- ignore this. saw the description now

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made the change to the other way around. agreed that it makes more sense to make latest an alias to the current version.
symlink doesnt work apparently, #16496 was using symlink. mkdocs gh-deploy does not follow symlink, so we have to make a copy post build

@kevinjqliu kevinjqliu force-pushed the kevinjqliu/fix-site-version-alias-followup branch from bc647a0 to f01443c Compare May 23, 2026 19:45
@kevinjqliu kevinjqliu changed the title Site: Fix version URL alias for static hosting Site: Resolve both latest version (/docs/1.11.0/) and its alias (/docs/latest/) May 23, 2026
@kevinjqliu kevinjqliu requested a review from stevenzwu May 23, 2026 19:59
Comment thread site/dev/common.sh
Comment on lines +106 to +109
# Sets up the 'latest' javadoc symlink pointing at ICEBERG_VERSION.
# Arguments:
# $1: ICEBERG_VERSION - The version number of the documentation to be treated as the latest.
create_latest () {
# $1: ICEBERG_VERSION - The version number to expose as 'latest'.
create_latest_javadoc_symlink () {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is changed because we no longer create versioned-docs/latest/ folder, its done via post build hook instead

Comment thread site/hooks/version_alias.py Outdated
Creates a symlink so that /docs/<icebergVersion>/ resolves to /docs/latest/.
This allows version-specific URLs (e.g. /docs/1.11.0/) to work without
duplicating the navigation entry for the latest version.
Creates docs/<icebergVersion>/ from the built docs/latest/ output so that the
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made the change to the other way around. agreed that it makes more sense to make latest an alias to the current version.
symlink doesnt work apparently, #16496 was using symlink. mkdocs gh-deploy does not follow symlink, so we have to make a copy post build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants