-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Attempt to rebuild docs build process, inspired by #6319 #6371
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
Conversation
✅ Deploy Preview for knative ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
@rohan-019, I'd love your review. @Cali0707 or @dprotaso -- if you have some cycles, please take a look. |
The |
|
||
```bash | ||
kubectl apply --filename {{artifact(repo="net-contour",file="contour.yaml")}} | ||
kubectl apply --filename {{artifact(repo="net-contour",org="knative-extensions",file="contour.yaml")}} |
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 noticed some build complaints trying to fetch these from the wrong place. If they offend, I can revert and offer these separately.
|
||
#sub-nav li:nth-last-child(3), #sub-nav li:nth-last-child(2), #sub-nav li:nth-last-child(1) { | ||
display: none; | ||
} | ||
|
||
|
||
/* bit of a hack to stop the banner taking space when empty */ |
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.
This is how we hid the "blog" "about" and "community" nav items from the bar in the redesign. Sorry I missed this!
# rm -rf $TEMP | ||
echo "Temp dir was: $TEMP" |
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 can put back this removal, but I found it helpful sometimes to poke into these temp directories while debugging.
# Don't try to version-match outside Knative-managed repos | ||
if org not in ("knative", "knative-extensions"): | ||
return f'https://github.com/{org}/{repo}/releases/latest/download/{file}' |
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.
Another attempt to avoid a bunch of build time complaints (though there are still a bunch of others that seem harmless but annoying).
# Allow `.meta.yml` to define metadata for all pages below that directory. | ||
# See https://squidfunk.github.io/mkdocs-material/plugins/meta/ | ||
meta: | ||
enabled: true |
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.
We use this to set the version / outdated / sample branch fields for the versioned documentation in the shell script.
@@ -6,7 +6,7 @@ | |||
|
|||
[build.environment] | |||
NODE_VERSION= "22" | |||
PYTHON_VERSION = "3.9" | |||
PYTHON_VERSION = "3.13" |
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.
awesome-pages
needs at least 3.10, but I didn't see a good reason not to move past that point.
@@ -97,7 +97,7 @@ | |||
</a> | |||
</li> | |||
<li class="md-tabs__item"> | |||
<a href="/docs/about/testimonials/" class="md-tabs__link"> | |||
<a href="/about/testimonials/" class="md-tabs__link"> |
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.
We may want to do something more sophisticated / reach out to the material mkdocs team to figure out a better solution for these top-level menu tabs. I'm not sure they were designed or thought through on mobile.
{# Create nav from the "section" of docs that we are in. | ||
Some sections (about, community) are not versioned, while docs is. #} | ||
{% set section = nav | selectattr("active") | first %} | ||
{% if section %} | ||
{% set nav = section %} | ||
{% endif %} |
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.
This is the new bit, the rest is imported from upstream.
/lgtm I did a pass through the preview and it looked fine (eg. the URLs paths work as expected). Feel free to unhold As a follow up we might want to drop the the version picker on the home page (and other pages) when you're not looking at the docs |
Oh, good point. Unfortunately, I think that may be tricky given that the version picker is added via TypeScript, which is built into a minified bundle: https://github.com/squidfunk/mkdocs-material/blob/master/src/templates/assets/javascripts/integrations/version/index.ts#L151 We may be able to manually set |
I fixed the GitHub Action and the version picker appearing on unversioned pages. I also chased down a number of Hugo shortcodes (in blog and |
3ba9093
to
1f149a5
Compare
/hold cancel |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dprotaso, evankanderson 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 |
…ive#6371) * Attempt to rebuild docs build process * Use a more modern python version * Fix strict verify, hide versions on unversioned pages
* Phase 1: Adding documentation metadata tags (#6274) * Add metadata tags for documentation * Add classification for about 2/3rds of docs (func + eventing) * Add classification for remainder of docs (serving+install) * Add mermaid support (#6327) * Publish threat model in documentation (#6263) * Publish threat model in documentation * Separate security contents a bit more, update link to threat model, update nav * Add a section on supply chain and SBOM/SLSA mitigation * Update threat model with feedback from David Hadas * Update introduction with content from davidhadas, add sections on controller and webhook functionality and update targets of threats * content tab fixes, added success output for kn func (#6367) * Add dry run section and take out old feature flag in serving (#6366) * add dry run section * drop mention of old feature flag * fix casing on nav * update docs to be more clear and include inline example --------- Co-authored-by: Dave Protasowski <[email protected]> * Attempt to rebuild docs build process, inspired by #6319 (#6371) * Attempt to rebuild docs build process * Use a more modern python version * Fix strict verify, hide versions on unversioned pages * Fix search with mkdocs typescript patches (vendored). (#6392) Hopefully, this can be fixed upstream via PR shortly. * Installation Doc Updates (#6395) * Installation Doc Updates Improve installation guidance * Formatting fix * Update docs/install/README.md link fix Co-authored-by: Evan Anderson <[email protected]> * Update docs/install/README.md link fix Co-authored-by: Evan Anderson <[email protected]> * link fix and table update More writing * Update README.md Misc edits * Update README.md Minor edits * Adding install-kn to PR Consolidating CLI installations into this this topic. * Update install-kn.md Changing red bug alert to important The old syntax was: ??? bug "Having issues upgrading `kn` to Homebrew?" * Update install-kn (snippet) Removed alert formatting * Added quickstart-install.md Various edits * Fixes and reviewed edits Made Evan suggestions, table column test, spelling fixes * Update quickstart-install.md link fix * Update README.md Replaced the table with a bulleted list approach. * Update README.md Put back the table * Added serving and eventing install topics Updated topics per effort - consolidating guidance * Link fixes * Made Evan's edits * Various updates All files added for this PR. * Link fix * Formatting fixes * Formatting and consistency fix * Update docs/install/operator/knative-with-operator-cli.md Co-authored-by: Evan Anderson <[email protected]> * Update docs/client/install-kn.md Co-authored-by: Evan Anderson <[email protected]> --------- Co-authored-by: Evan Anderson <[email protected]> * Fix edit page links, move technical docs under sub-heading (#6398) * Fix edit links by moving docs content under a dedicated subdirectory * Fix edit links by moving docs content under a dedicated subdirectory * Add High availability documentation section for eventing (#6401) I have copy-pasted from the Knative Serving documentation page the block as I found it missing when configuring it. * Update proc-running-function.md (#6400) Undo separeate kn func output for invoke * Add a note that Apache Kafka is required to use EKB (#6404) * Move install docs to administration (#6403) * Fix trailing newline complaints * Fix redirects from #6398 --------- Co-authored-by: Bruce Hamilton <[email protected]> Co-authored-by: Alexander-Kita <[email protected]> Co-authored-by: Dave Protasowski <[email protected]> Co-authored-by: Aurélien Joga <[email protected]> Co-authored-by: Christoph Stäbler <[email protected]>
Fixes #6292 #6302
Proposed Changes
Rewrites the documentation building system to run
mkdocs build
exactly once, with all the files in the tree. The current build runsmdocs build
N+2 times for the number of releases we have (N releases, plus "development" and "blog"), and forces our homepage, about, and community sites to live underhttps://knative.dev/docs
because versioning.I believe this is relatively complete, but we are stretching the capabilities of
mkdocs
. I think it's still worth it, but I wanted to get this generally-working checkpoint in before going further. (See also the unfortunate breakages that @rohan-019 had to deal with in #6319)I discovered that
awesome-pages-plugin
had been replaced byawesome-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 subtree of the site separately.I replaced a global environment variables with page metadata for things like Knative version and whether there is a newer version. The global environment variables weren't going to work well with a single
mkdocs
run.Eventually, we probably want to move the documentation content to a sub-directory, but I used
mv
for testing. This is probably wrong; I ended up copying some images for now to avoid making weird break/fix changes.I removed the extra "blog" build, which removed a lot of duplicated (or even never-referenced) files and images. That's the majority of the file status of this PR.
Because the top-level page got moved up to
/
, I needed to redo theredirects.yml
. We also currently use this to redirect the top-level docs page toconcepts/
, but when we move the docs under a dedicated sub-directory, we should move that page up to the top level.I needed to tweak the navigation templates in a few places. Logically, we have four levels of navigation:
I think this is generally correct, but there is definitely a lot. We might relocate the TOC navigation within the between-page nav (Material-Mkdocs has an option for this), but I didn't want to mess with it here. There's probably also some additional fixing to be done -- I think we may need to re-do the top nav bar to get it working well on mobile. I also didn't work on that, because this PR is nearly-unreviewable as is.