KAFKA-20541 : Move 42/generated from static/ to content/#856
Conversation
|
Thanks for picking this up. I guess I should put some thoughts in the Jira when opening it. While your PR resolve the duplication, I'm not sure it's the approach we should take to resolve this. When we generate docs for a release, the I wonder if the website should pick |
@mimaison pls let me know if the below approach is better to handle this situation. Currently there are a few empty files in content/en/42/generated too. Finally update the release playbook, so for 4.3 onwards, we can keep the generated/ with the docs. We don't have to copy it to the static folder. I tested this locally and it works. |
|
@mimaison pushed the changes too. It's a large PR, but mostly moving of files to content dir, and handling the include-html shortcode. |
|
Yes I think something along these lines would work. Thanks for figuring it out. I'm wondering whether we should keep all existing versions as is, at least for now, and only start with the new scheme for newer versions. So we'd do the changes in the kafka repository instead. Also it seems the new process requires editing hugo.yaml for each release, could we invert the process to include mapping all existing versions, and not require changes for new releases? |
@mimaison new changes now handle only newer versions and no edits are required for hugo config going fwd. And for new releases: copy docs/ into content/en// and images/javadoc into static//, catch-all will take care. |
|
I've just tried with 43 (rebasing your branch on top of markdown) and even though |
Yes, that's expected. It will work in both ways. static//generated/ (old way) served by Default static → static mount RM can ship generated/ under either static// or content/en// and both work. |
|
If it's expected to work both ways, can you clarify why 4.2 is treated as a one off? |
Both ways work in the sense that files exist in either content/en//generated/ or static//generated/ , pick one. 4.2 is the only version where files exist in both dirs (real files and empty stubs). And to prevent that catch-all from serving those empty stubs, we added excludeFiles config https://github.com/apache/kafka-site/pull/856/changes#diff-5928f4025679c9eee397ca3795367f71f667ce1f25018b7f7ae7c574da1f2f08R524 And per your earlier comment, we left 4.2 untouched in this PR. |
|
Now that 4.2.1 is out, maybe we can update 4.2 to match 4.3 to get rid of its unique configuration. Sorry for the back and forth, I'm figuring it out myself. |
7922002 to
58cbfc0
Compare
Done. Removed content/en/42/generated/ to match 4.3's layout, and dropped the excludeFiles line. |
|
Sorry but as I said in #856 (comment), when building the docs the Currently
Does that make sense? |
Yes.
|
|
Thanks for the updates! This looks good. Can we also update the README? Section that would need updating are:
We also need to update https://github.com/apache/kafka-site/blob/markdown/scripts/replace-version-links.sh |
Previously, content/en/42/generated/ held empty stubs while the real HTML fragments and connect_rest.yaml lived in static/42/generated/. Move the files to content/en/42/generated/ so the layout matches apache/kafka's docs/generated, and add a module.mounts entry in hugo.yaml that re-exposes them at /42/generated/ so the download URL for connect_rest.yaml is unchanged. - include-html shortcode reads from content/en/<v>/generated/, with a fallback to /static/... for pre-4.2 versions - 24 include-html calls in content/en/42 switched to the short form - replace-version-links.sh and README/CLAUDE.md updated for the new release workflow (don't copy generated/ into static/)
791b506 to
2026f86
Compare
Thanks. Updated all four:
|
module.mountsentry inhugo.yamlso future Kafka releases that shipdocs/generated/undercontent/en/<v>/generated/(the layout used byapache/kafka) are served at/<v>/generated/URLs automatically/42/generated/connect_rest.yamlstill downloads the original filecontent/en/99/generated/test.htmlwhich is served at/99/generated/test.html