Skip to content

Conversation

rohan-019
Copy link

Migrate documentation from /docs/* to root domain with 301 redirects

Overview

This PR restructures the Knative documentation URL hierarchy by moving content from https://knative.dev/docs/* to https://knative.dev/*, creating a cleaner and more intuitive navigation experience.

fixes: #6292

Changes Made

Configuration Updates

  • mkdocs.yml: Updated site_url from https://knative.dev/docs to https://knative.dev
  • blog/mkdocs.yml: Updated homepage reference to point to root domain
  • netlify.toml: Added comprehensive redirect rules for seamless URL migration

Redirect Strategy

# Redirect all /docs/* paths to root-relative equivalents
[[redirects]]
  from = "/docs/*"
  to = "/:splat"
  status = 301

# Serve root path as the documentation homepage  
[[redirects]]
  from = "/"
  to = "/index.html"
  status = 200

Benefits

  • Improved UX: Shorter, cleaner URLs that are easier to share and remember
  • SEO Preservation: 301 redirects maintain search engine rankings and link equity
  • Zero Downtime: Backward compatibility ensures no broken links or service interruption
  • Future-Proof: Simplified URL structure supports better site organization

Testing Completed

  • ✅ Verified /docs/*/* redirects function correctly
  • ✅ Confirmed root domain serves documentation properly
  • ✅ Validated internal link functionality
  • ✅ Tested backward compatibility with existing bookmarks
  • ✅ Confirmed SEO-friendly 301 redirect behavior

Impact

  • Immediate: Documentation accessible at cleaner root URLs
  • Gradual: Search engines will re-index URLs over time
  • No Breaking Changes: All existing /docs/* URLs remain functional via redirects

- Updated base URL configuration from knative.dev/docs to knative.dev
- Added comprehensive 301 redirects for smooth transition
- Updated blog configuration to point to new base URL
- Ensures backward compatibility with existing links and search results

This change routes the base URL for Knative docs to knative.dev instead of knative.dev/docs, while maintaining backward compatibility through proper redirects that won't break search results or existing links.
Copy link

linux-foundation-easycla bot commented Aug 7, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

Copy link

netlify bot commented Aug 7, 2025

Deploy Preview for knative ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 1d74163
🔍 Latest deploy log https://app.netlify.com/projects/knative/deploys/68bbd2b5bb30b40008f5230a
😎 Deploy Preview https://deploy-preview-6319--knative.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@knative-prow knative-prow bot requested review from Leo6Leo and nainaz August 7, 2025 07:25
Copy link

knative-prow bot commented Aug 7, 2025

Welcome @rohan-019! It looks like this is your first PR to knative/docs 🎉

@knative-prow knative-prow bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Aug 7, 2025
@evankanderson
Copy link
Member

/ok-to-test

@knative-prow knative-prow bot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Aug 7, 2025
@evankanderson
Copy link
Member

evankanderson commented Aug 7, 2025

Hey, @rohan-019 ! Thanks for doing this. In the preview, I'm not seeing the described effect, though I can see that you made changes intended to produce this effect. Am I looking at something wrong? E.g.

curl https://deploy-preview-6319--knative.netlify.app/
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Redirecting</title>
  <noscript>
    <meta http-equiv="refresh" content="1; url=docs/" />
  </noscript>
  <script>
   window.location.replace("docs/");
  </script>
</head>
<body>
  Redirecting to <a href="docs/">docs/</a>...
<div data-netlify-deploy-id="689454c7a928040008797ac2" data-netlify-site-id="c68aa66e-b64a-4a94-bf01-abcc56573e93" data-vcs="github" style="position:fixed">

  <script async src="/.netlify/scripts/cdp"></script>
</div></body>
</html>

(and yes, serving HTML for a 301 is not great...)

@rohan-019
Copy link
Author

Hi @evankanderson, Thanks for checking! It looks like the root is still serving a redirect to /docs/, which means the Netlify build output path is probably still pointing at /docs. I’ll update the Netlify publish directory (or verify the MkDocs build path) so the docs are served directly at /. The 301 redirect from /docs/* → / will stay in place so existing links and crawlers are preserved.

@knative-prow knative-prow bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 17, 2025
@rohan-019 rohan-019 closed this Aug 18, 2025
@rohan-019 rohan-019 deleted the blackboxai/route-base-url-to-knative-dev branch August 18, 2025 12:09
@rohan-019 rohan-019 restored the blackboxai/route-base-url-to-knative-dev branch August 18, 2025 12:09
@rohan-019 rohan-019 reopened this Aug 18, 2025
@rohan-019 rohan-019 closed this Aug 18, 2025
@rohan-019 rohan-019 deleted the blackboxai/route-base-url-to-knative-dev branch August 18, 2025 12:18
@rohan-019 rohan-019 restored the blackboxai/route-base-url-to-knative-dev branch August 18, 2025 12:23
@rohan-019 rohan-019 reopened this Aug 18, 2025
@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 22, 2025
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 23, 2025
Copy link
Member

@evankanderson evankanderson left a comment

Choose a reason for hiding this comment

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

I'm sorry for the delay; I'm traveling until Tuesday evening with only my phone. I'll try to take a look at this tonight, but I might not be able to approve before Wednesday if there are complicated bits to investigate.

Copy link
Member

@evankanderson evankanderson left a comment

Choose a reason for hiding this comment

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

/approve

Let me know how you want to approach testing the new URL paths; I'm not sure how moving all the docs to the root will affect things like the nav.

Copy link

knative-prow bot commented Aug 24, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: evankanderson, rohan-019

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 24, 2025
@rohan-019
Copy link
Author

I'm sorry for the delay; I'm traveling until Tuesday evening with only my phone. I'll try to take a look at this tonight, but I might not be able to approve before Wednesday if there are complicated bits to investigate.

No problem at all, and sorry for my late response too. Thanks for reviewing—I’ll check it now.

@rohan-019
Copy link
Author

cc: @evankanderson

@evankanderson
Copy link
Member

I've cloned your changes locally, and run the following commands (on Linux, sorry!) to get a build working and browsable:

$ uv tool install --with mkdocs-material --with mkdocs-exclude --with mkdocs-macros-plugin --with mkdocs-awesome-pages-plugin --with mkdocs-git-revision-date-localized-plugin --with mkdocs-redirects --with mkdocs-rss-plugin --with semver --with pygithub mkdocs

$ export GITHUB_TOKEN=$(gh auth token)

$ ./hack/build.sh

$ (cd site; python -m http.server 8000)

Unfortunately, the top-nav seems busted for the v1.19 version, and a lot of the meta-data (such as the canonical link in site/about/case-studies/index.html, to pick on one selected at random) and footers also seem to have broken links.

(Also, it looks like you haven't signed the LF CLA, so you'll need to do that before this can get merged.)

@evankanderson
Copy link
Member

I think (based on #6502), we may want the following URL structure:

  • knative.dev/ --> new index.html page from this PR
  • knative.dev/docs --> content from docs/concepts/README.md, updated with 6321, when available, and then all other documentation (/docs/install, etc) under that.
  • knative.dev/v1.17-docs/ --> previous version docs
  • knative.dev/about --> previous docs/about
  • knative.dev/blog --> blog, as before
  • knative.dev/community --> previous docs/community

I think that should minimize the amount of redirects / broken links that need to be adjusted, while moving all the non-technical documentation out of the versioned section.

I don't know if we want to implement this as adding another layer docs/docs, or moving specific items up one layer in the file hierarchy.

@rohan-019 rohan-019 force-pushed the blackboxai/route-base-url-to-knative-dev branch from 13ec24f to 1cc1ca0 Compare September 5, 2025 12:04
Signed-off-by: rohan-019 <[email protected]>
@knative-prow knative-prow bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 5, 2025
Copy link
Member

@evankanderson evankanderson left a comment

Choose a reason for hiding this comment

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

I'm sorry that this is proving so gnarly!

I've tried poking a bit at your configuration, and I'm also having trouble figuring out the best path. So far, what I think might work:

  1. Keep the build.sh script mostly the same.
  2. Copy the docs/index.html from site up to the root level after the build, instead of creating the site/index.html directly.
  3. You might consider doing the same treatment for about and community, and fixing the links in overrides/partials/header.html, but that might be too much.

Sorry to have had a hidden minefield in here -- I'm guessing that's part of why it wasn't fixed previously!

@rohan-019
Copy link
Author

I'm sorry that this is proving so gnarly!

I've tried poking a bit at your configuration, and I'm also having trouble figuring out the best path. So far, what I think might work:

  1. Keep the build.sh script mostly the same.
  2. Copy the docs/index.html from site up to the root level after the build, instead of creating the site/index.html directly.
  3. You might consider doing the same treatment for about and community, and fixing the links in overrides/partials/header.html, but that might be too much.

Sorry to have had a hidden minefield in here -- I'm guessing that's part of why it wasn't fixed previously!

Thanks a lot for the back-to-back responses. I’ll review and make the updates, then get back to you shortly.

- Restore version JSON block for version picker functionality
- Stop copying /about and /community into versioned builds
- Restore API reference curl fetches for serving-api.md and eventing-api.md
- Restore /development build step
- Copy index.html and sitemap.xml to root after build
- Update navigation to point to correct paths (root vs versioned)
- Fix top-nav links to use proper URL structure
@rohan-019
Copy link
Author

Home.-.Knative.-.Google.Chrome.2025-09-06.11-45-22.mp4

What doesn't: Docs and Blog pages show "files not found"
This appears to be a preview server limitation (npx http-server site) rather than an issue with the build process or my fixes.
Ready for review when convenient!
cc: @evankanderson

Copy link
Member

@evankanderson evankanderson left a comment

Choose a reason for hiding this comment

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

This looks close! I'll try rebuilding this afternoon to double-check. If the move of about and community works, then I'll approve and sort the preview builds out later.

@@ -27,7 +27,7 @@ set -x
# 1) Make a release-NN branch as normal.
# 2) Update VERSIONS below (on main) to include the new version, and remove the oldest
# Order matters :-), Most recent first.
VERSIONS=("1.18" "1.17") # Docs version, results in the url e.g. knative.dev/docs-1.9/..
VERSIONS=("1.19" "1.18" "1.17") # Docs version, results in the url e.g. knative.dev/v1.9-docs/..
Copy link
Member

Choose a reason for hiding this comment

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

We're not quite ready to release 1.19 -- the OpenTelemetry changes came in late and we've had to push some bug fixes.

# Create docs directory structure
mkdir -p "$SITE/docs"

# Build latest docs to /docs
Copy link
Member

Choose a reason for hiding this comment

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

We were building the next-release docs to /development/... and the most-recent-release docs to /docs/.... I think you've changed this to build the next-release docs to /docs/..., and not publish docs for the current release anywhere.

Comment on lines 43 to +45
if [ "$BUILD_VERSIONS" == "no" ]; then
# HEAD to /docs if we're not doing versioning.
mkdocs build -f mkdocs.yml -d site/docs
# Build to root if we're not doing versioning
mkdocs build -f mkdocs.yml -d site
Copy link
Member

Choose a reason for hiding this comment

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

FWIW, this "tiny build for preview" seems to potentially be the part that's messing things up. I wonder if we want to remove it for now, and leave a TODO to optimize this later. (The preview version is also not importing the serving/eventing reference docs, and makes it hard to reason about these sorts of changes from the preview.)

Comment on lines +76 to +79
# Build development site
pushd "$TEMP/docs-main"
KNATIVE_VERSION="${VERSIONS[0]}.0" SAMPLES_BRANCH="${DOCS_BRANCHES[0]}" mkdocs build -f mkdocs.yml -d "$SITE/development"
popd
Copy link
Member

Choose a reason for hiding this comment

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

Why are we repeating 56-58 here?

Comment on lines +81 to +85
# Move non-versioned content to root level
mkdir -p "$SITE/about"
cp -r "$TEMP/docs-main/docs/about" "$SITE/"
mkdir -p "$SITE/community"
cp -r "$TEMP/docs-main/docs/community" "$SITE/"
Copy link
Member

Choose a reason for hiding this comment

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

I think this may break links for images, CSS, and JavaScript for these pages. I'll attempt another build with your changes this afternoon (I avoided this PR yesterday because I had a few other items and I really got pulled in on Friday).

Copy link
Member

Choose a reason for hiding this comment

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

The index.html did seem to mostly work with just a copy, mostly because that page is largely hand-crafted HTML.

There are still a few items I'm trying to figure out in the navigation -- like why the "blog", "about", and "community" links don't show up in the navigation tabs, despite being in nav.html.

Comment on lines +91 to 95
# Create version JSON for version picker
versionjson=""
for i in "${!previous[@]}"; do
version=${previous[$i]}
versionjson+="{\"version\": \"v$version-docs\", \"title\": \"v$version\", \"aliases\": [\"\"]},"
Copy link
Member

Choose a reason for hiding this comment

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

This was previously in the loop on 60-74. I don't have a strong opinion, but it feels slightly odd to have the same loop twice with some other actions in between.

@rohan-019
Copy link
Author

This looks close! I'll try rebuilding this afternoon to double-check. If the move of about and community works, then I'll approve and sort the preview builds out later.

Thanks for the detailed feedback, @evankanderson
I’ll hold off on making further changes until after your rebuild check, so we don’t introduce unnecessary churn.

I’ve noted the possible follow-ups from your review:
-Not including 1.19 in VERSIONS yet
-Ensuring next-release docs go under /development/... instead of /docs/...
-Reconsidering the tiny build-for-preview block
-Avoiding duplicate build steps
-Checking the about and community move for broken links/resources
-Simplifying the version JSON loop

Once you confirm whether the current changes work, I’ll be ready to address any of these (either here or in a follow-up PR as appropriate).

@evankanderson
Copy link
Member

Building the multi-version site and then moving index.html up one level produces a lot of broken links in /index.html:

127.0.0.1 - - [09/Sep/2025 13:33:55] "GET / HTTP/1.1" 304 -
127.0.0.1 - - [09/Sep/2025 13:33:55] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:55] "GET /.well-known/appspecific/com.chrome.devtools.json HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:55] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:55] "GET /assets/stylesheets/main.7e37652d.min.css HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:55] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:55] "GET /stylesheets/extra.css HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:55] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:55] "GET /images/logo/rgb/knative-logo-rgb.png HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:55] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:55] "GET /assets/stylesheets/home.css HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:55] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:55] "GET /images/home-images/blue_functions_icon.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:55] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:55] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:55] "GET /images/home-images/blue_event_based_icon.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:55] "GET /images/home-images/blue_http_first_icon.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:55] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:55] "GET /js/cookie-consent.js HTTP/1.1" 304 -
127.0.0.1 - - [09/Sep/2025 13:33:55] "GET /assets/javascripts/bundle.92b07e13.min.js HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:55] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:55] "GET /images/home-images/blue_event_intergrations_icon.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:56] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:56] "GET /images/home-images/blue_kubernetes_integrated_icon.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:56] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:56] "GET /images/home-images/blue_plugable_icon.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:56] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:56] "GET /images/home-images/knative_flowchart_graphic.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:56] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:56] "GET /images/home-images/Kelsey.png HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:56] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:56] "GET /images/case-studies/sva.png HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:56] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:56] "GET /images/case-studies/ibm.png HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:56] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:56] "GET /images/case-studies/pnc_bank.png HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:56] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:56] "GET /images/home-images/cncf-color.png HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:56] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:56] "GET /images/logo/rgb/knative-logo-rgb.png HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:56] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:56] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:56] "GET /images/corporate-logos/scaleway.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:56] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:56] "GET /images/corporate-logos/grerook.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:56] "GET /images/corporate-logos/property_xyz.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:56] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:56] "GET /images/corporate-logos/ka-nabell_japan.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:56] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:56] "GET /images/corporate-logos/chainguard.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:56] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:56] "GET /images/corporate-logos/vhive.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:56] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:56] "GET /images/corporate-logos/y_meadows.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:56] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:56] "GET /images/corporate-logos/sva.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:56] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:56] "GET /images/corporate-logos/control_plane.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:57] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:57] "GET /images/corporate-logos/liquidx.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:57] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:57] "GET /images/corporate-logos/vorteil-direktiv.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:57] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:57] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:57] "GET /images/corporate-logos/tata_comm.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:57] "GET /images/corporate-logos/high_cohesion.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:57] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:57] "GET /images/corporate-logos/bloomberg.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:57] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:57] "GET /images/corporate-logos/gojek.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:57] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:57] "GET /images/corporate-logos/blue_origin.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:57] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:57] "GET /images/corporate-logos/kubesphere.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:57] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:57] "GET /images/corporate-logos/vmware.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:57] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:57] "GET /images/corporate-logos/ibm.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:57] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:57] "GET /images/corporate-logos/redhat.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:57] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:57] "GET /images/corporate-logos/spider.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:57] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:57] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:57] "GET /images/corporate-logos/alauda.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:57] "GET /images/corporate-logos/alibaba_cloud.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:57] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:57] "GET /images/corporate-logos/google.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:57] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:57] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:57] "GET /images/corporate-logos/manomano.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:57] "GET /images/corporate-logos/box.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:57] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:57] "GET /images/corporate-logos/deepc.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:58] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:58] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:58] "GET /images/corporate-logos/fulcrum.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:58] "GET /images/corporate-logos/sonavi_labs.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:58] code 404, message File not found
127.0.0.1 - - [09/Sep/2025 13:33:58] "GET /images/corporate-logos/optum.svg HTTP/1.1" 404 -
127.0.0.1 - - [09/Sep/2025 13:33:58] "GET /js/js.cookie.js?_=1757450036006 HTTP/1.1" 200 -

@evankanderson
Copy link
Member

I think I might have a solution, but it's a bit more invasive. Frankly, this never worked quite right to begin with (witness the homepage redirecting to /docs), so that's not entirely surprising.

@rohan-019
Copy link
Author

uilding the multi-version site and then moving index.html up one level produces a lot of broken links in /index.html:

What Happened 🔍
When we copied index.html and sitemap.xml from /docs/ to root /, we created a path mismatch:
index.html is now at root /
But all assets (CSS, JS, images) are still in /docs/assets/, /docs/images/, etc.
Result: index.html tries to load /assets/... but they're actually at /docs/assets/...
The Fix ��
We need to copy the entire asset structure to root, not just the HTML files:

@rohan-019
Copy link
Author

If you already have a more invasive fix in mind, I’m happy to wait for your direction and adjust this PR (or follow up in a new one) once the bigger change is in place.

@evankanderson
Copy link
Member

I have a partial fix that involves moving the documentation into a sub-directory, and doing one mkdocs build across the whole site. I think it probably needs a bunch of additional cleanup, but I needed to poke at the code to understand what I might be able to do:

https://github.com/knative/docs/compare/main...evankanderson:docs:docs-rebuild?expand=1

(Ignore the blog changes, I think I screwed up something when committing things quickly.)

I don't have things entirely fixed, but the changes to the nav partial seem to get the secondary bar nav working again:

image

I need to get the sidebar nav to cut out one more level, which probably means overriding more partials, and adding some documentation about why we're doing what we're doing.

@evankanderson
Copy link
Member

(But I need to get out and run right now -- more updates later tonight, or feel free to ask questions / take my changes and run with them)

@rohan-019
Copy link
Author

Thanks for digging into this, @evankanderson
I’ll take a look at your branch and review how the single mkdocs build + sub-directory approach works. The secondary bar nav fix sounds promising. I’ll hold off on touching the blog changes since you mentioned those were accidental.

Happy to either wait for your next update or pick up from your branch if that helps move things forward faster.

@evankanderson
Copy link
Member

Feel free to pull in changes from my branch, and I can add some PRs to your branch as well if you want.

A few things from my branch:

  • I discovered that awesome-pages-plugin had been replaced by awesome-nav, which has a few more features. One feature is being able to build up global nav from .nav.yaml files in directories. I used that to build up the nav for each version separately.
  • I replaced a few global environment variables with page metadata for things like Knative version and whether there is a newer version.
  • Eventually, we probably want to move the documentation content to a sub-directory, but I used mv for testing. This is probably wrong, as it will break some image links.
  • We'll probably need to do some manual fixes (like removing some of the nav entries from older versions using sed) for a couple versions until the old build process ages out.

@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 13, 2025
@knative-prow-robot
Copy link
Contributor

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

knative-prow bot pushed a commit that referenced this pull request Sep 15, 2025
* Attempt to rebuild docs build process

* Use a more modern python version

* Fix strict verify, hide versions on unversioned pages
@evankanderson
Copy link
Member

You probably saw, but #6371 merged, which I think includes this functionality.

Thanks for starting on this, and highlighting a lot of the challenges. Your work probably saved me a couple days of trying things before I ended up with that PR (which is pretty big). There are still a number of additional cleanup items from that if you're interested:

  • I move a bunch of files from docs/{foo} into docs/docs/{foo} in the build, and then to docs/development/{foo}. (and the files will eventually go into v-X.Y-docs directories). It would probably make sense to move the files in the git repository, and then make the mv commands conditional on the older structure being in place. We can then age out the old layout over the next 3 releases (or cherry-pick work to get them out sooner, but that seems to have low return).

  • There are a bunch of warnings in the build logs because things are inconsistent between directory references and references to the README.md in the directory. This is probably an "easy" cleanup, though the benefit is not really high unless we can turn on stricter link checking.

  • There's a bunch of other documentation work in CNCF Tech Doc Recommendations: Umbrella Issue #6301 if you want to pick up another issue.

Thanks again for getting this work started! I think the end result is an improvement, and I really viewed this as a team effort -- I wouldn't have done it without you.

@rohan-019
Copy link
Author

Hi @evankanderson,

very sorry for the late reply — I got caught up with some other work last week.

Really glad to see #6371 merged 🎉 It’s great that our back-and-forth and experiments led to that outcome. Thanks for building on the initial work I started and pushing it through — the end result looks like a big improvement.

I appreciate the detailed notes on the follow-up cleanup tasks. I’d be happy to start looking into some of the smaller items, like directory moves or link consistency. I’ll also take a look at the CNCF Tech Doc Recommendations umbrella issue (#6301) to see where else I can contribute.

Thanks again for treating this as a team effort — I learned a lot through this process and really enjoyed collaborating on it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make knative.dev to be the base url
3 participants