stevenzwu commented on code in PR #16497:
URL: https://github.com/apache/iceberg/pull/16497#discussion_r3305965566


##########
site/README.md:
##########
@@ -93,21 +95,23 @@ This step will generate the staged source code which blends 
into the original so
 ./site/
 ├── versioned-docs
 │   ├── nightly (symlink to /docs/)
-│   ├── latest (symlink to versioned-docs/<latest-version>)

Review Comment:
   are we going to have the `latest` folder in the `versioned-docs` after this 
change?



##########
site/README.md:
##########
@@ -93,21 +95,23 @@ This step will generate the staged source code which blends 
into the original so
 ./site/
 ├── versioned-docs
 │   ├── nightly (symlink to /docs/)
-│   ├── latest (symlink to versioned-docs/<latest-version>)
-│   ├── 1.4.0
-│   ├── 1.3.1
+│   ├── <icebergVersion> (current release, e.g. 1.11.0)
+│   ├── 1.10.2
+│   ├── 1.10.1
 │   └── ...
 ├── docs
 │   ├── javadoc
-│   │   ├── nightly (currently points to latest)
-│   │   ├── latest
-│   │   ├── 1.4.0
-│   │   ├── 1.3.1
+│   │   ├── nightly (symlink to latest)

Review Comment:
   nightly shouldn't point to the `latest` release (currently 1.11.0). nightly 
should point to the docs generated from latest nightly build for the main 
branch. 
   
   maybe just follow the versioned-docs above: `nightly (symlink to /javadoc)`?



##########
site/README.md:
##########
@@ -189,17 +193,17 @@ As mentioned in the MkDocs section, when you build MkDocs 
`mkdocs build`, MkDocs
 │   ├── nightly
 │   │   ├── docs
 │   │   └── mkdocs.yml
-│   ├── latest
+│   ├── <icebergVersion>
 │   │   ├── docs
 │   │   └── mkdocs.yml
-│   └── 1.4.0
+│   └── 1.10.2

Review Comment:
   maybe just drop this entry and only keep `<icebergVersion>` entry so that it 
doesn't get stale, which is the approach you choose for the `javadoc` below



##########
site/README.md:
##########
@@ -189,17 +193,17 @@ As mentioned in the MkDocs section, when you build MkDocs 
`mkdocs build`, MkDocs
 │   ├── nightly
 │   │   ├── docs
 │   │   └── mkdocs.yml
-│   ├── latest

Review Comment:
   should we keep the `latest` entry to be consistent with the `javadoc` below?



##########
site/README.md:
##########
@@ -93,21 +95,23 @@ This step will generate the staged source code which blends 
into the original so
 ./site/
 ├── versioned-docs
 │   ├── nightly (symlink to /docs/)
-│   ├── latest (symlink to versioned-docs/<latest-version>)
-│   ├── 1.4.0
-│   ├── 1.3.1
+│   ├── <icebergVersion> (current release, e.g. 1.11.0)
+│   ├── 1.10.2

Review Comment:
   should we just remove those specific versions as they will always become 
stale? just the `...` probably is good enough.



##########
site/hooks/search_index_current_version_only.py:
##########
@@ -0,0 +1,48 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""
+MkDocs hook: keep only the current version's docs in the search index.
+
+Excludes every page under ``docs/<segment>/`` where ``<segment>`` is not the
+current ``extra.icebergVersion``. Top-level site pages (community, blog, etc.)
+remain indexed. The ``docs/latest`` alias is created post-build (after the

Review Comment:
   Behavior change worth documenting: previously the `exclude-search` plugin 
was keyed on `docs/[0-9]*` (excluded versioned dirs) and `docs/latest/*` was 
indexed, so search results pointed at `/docs/latest/<page>/` — a stable URL 
that always resolved to the current release. With this hook, the canonical 
indexed path is `/docs/<icebergVersion>/<page>/` (version-pinned), and 
`/docs/latest/` is created post-build and produces no pages of its own. Net 
effect: a search-result bookmark captured today points at `/docs/1.11.0/...` 
and stays on 1.11.0 content after 1.12.0 ships, instead of auto-following 
`latest`. 
   
   This matches the new "version is canonical, latest is the alias" direction 
so it's intentional, but it's a real UX shift — worth a sentence in the PR 
description and code comment so reviewers and users aren't surprised.



##########
site/dev/common.sh:
##########
@@ -200,10 +183,10 @@ pull_versioned_docs () {
     git worktree add -f docs/javadoc "${javadoc_branch}"
   fi
   
-  # Create the 'latest' version of documentation
-  create_latest "${latest_version}"
+  # Create the 'latest' javadoc symlink
+  create_latest_javadoc_symlink "${latest_version}"

Review Comment:
   Nit (out of diff window): the `clean()` function at line 215 still has `rm 
-rf versioned-docs/latest &> /dev/null`. The early cleanup existed because the 
old `create_latest` wrote untracked content into `versioned-docs/latest/`, 
which would have prevented the `git worktree remove versioned-docs` below from 
succeeding cleanly. Now that nothing creates `versioned-docs/latest/`, that 
line is dead. The matching `nightly` line below is still required since 
`create_nightly` still writes there.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to