-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: route knative docs base URL from knative.dev/docs to knative.dev #6319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: route knative docs base URL from knative.dev/docs to knative.dev #6319
Conversation
- 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.
|
✅ Deploy Preview for knative ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Welcome @rohan-019! It looks like this is your first PR to knative/docs 🎉 |
/ok-to-test |
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.
(and yes, serving HTML for a 301 is not great...) |
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. |
There was a problem hiding this 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.
There was a problem hiding this 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.
@@ -61,7 +61,7 @@ else | |||
curl -f -L --show-error https://raw.githubusercontent.com/knative/eventing/${DOCS_BRANCHES[0]}/docs/eventing-api.md -s > "$TEMP/docs-$latest/docs/reference/api/eventing-api.md" | |||
fi | |||
|
|||
pushd "$TEMP/docs-$latest"; KNATIVE_VERSION="${VERSIONS[0]}.0" SAMPLES_BRANCH="${DOCS_BRANCHES[0]}" mkdocs build -d $SITE/docs; popd | |||
pushd "$TEMP/docs-$latest"; KNATIVE_VERSION="${VERSIONS[0]}.0" SAMPLES_BRANCH="${DOCS_BRANCHES[0]}" mkdocs build -d $SITE; popd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this do for the v1.18 docs (for example)?
It feels like we want to host the /docs/index.html
up to /index.html
, but maybe leave the other content (except the blog) under /docs
. I'm concerned mostly about the nav getting screwed up, but also it seems like the home page (and blog and community info) might actually be a different type of content than the versioned documentation.
Sorry to get this feedback to you late; I hadn't really looked at the current implementation until you sent this PR.
I'm willing to try moving forward with this and seeing what goes wrong, with the understanding that we might revert this change as the first fix if there are problems, and then later attempt a more complete fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@evankanderson Thank you for the thorough review and constructive feedback - I appreciate you taking the time to examine the implementation details.
This change affects how the latest documentation (v1.19) is served:
What happens to v1.18 docs: Nothing changes - they remain at knative.dev/v1.18-docs/
What changes: Only the latest/current docs move from knative.dev/docs/
to knative.dev/
(root)
Your navigation concern is valid - this creates inconsistent URL patterns:
- Latest docs: Root-level (
knative.dev/
) - Versioned docs: Subdirectory (
knative.dev/v1.18-docs/
) - Blog navigation: Still references
/docs/
paths (needs fixing)
Potential issues:
- Cross-version navigation links may break
- Blog → main site links will break (11 hardcoded
/docs/
references in blog/config/nav.yml) - Version switcher functionality needs testing
Mitigation: The 301 redirects handle SEO concerns, but we should:
- Fix blog navigation references immediately
- Test version switcher thoroughly
- Monitor for broken cross-references
- Have rollback plan ready
I agree with proceeding cautiously - the redirect strategy is solid for SEO, but navigation UX needs careful validation.
Immediate next steps:
- Fix blog navigation
/docs/
references - Test version switcher thoroughly
- Monitor cross-version link behavior
- Keep rollback plan ready
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.
Thanks for being willing to move forward thoughtfully - your "try and see what breaks" approach with proper safeguards is exactly right for this type of infrastructure change.
[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 |
No problem at all, and sorry for my late response too. Thanks for reviewing—I’ll check it now. |
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/*
tohttps://knative.dev/*
, creating a cleaner and more intuitive navigation experience.fixes: #6292
Changes Made
Configuration Updates
site_url
fromhttps://knative.dev/docs
tohttps://knative.dev
Redirect Strategy
Benefits
Testing Completed
/docs/*
→/*
redirects function correctlyImpact
/docs/*
URLs remain functional via redirects