-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Add a version indicator and selector to all docs pages #22725
Conversation
@meteorcloudy @fweikert This is a wild hack based on guesses on what the templating language looks like, but maybe this can serve as the basis for a proper solution. Is there a way you or I could check whether this at least works, ignoring that it looks horrible for now? |
|
Unfortunately no, only internal people can build the site.. but we can definitely help with this one, thanks for taking a look! |
I updated this to a new approach that doesn't rely on any templating syntax I couldn't find online. I also added a screenshot of the (manually created) result, PTAL. |
Wow, @fmeum you are awesome! I tried to build the site internally, almost worked!
|
This should be fixed, I had an extra slash.
Did you regenerate the
What happens when you click on the |
Could you share the generated code for some page for 7.2.0? It looks like the How did you build the 7.2.0 docs? Based on the picture, the |
This is an internal tool to build everything, I don't know the exact details. |
And your are right, |
Could you also share the raw For example, when I create a new
For some reason, it looks like the docs you generate do not have |
Alternatively, something may be wrong with this snippet in the PR:
The behavior you see would also be consistent with the Line 4 in d7c1441
|
I see the problem now, each version has a forked version of |
OK, the 7.2.0 _buttons.html should still be generated from the root version. I'm not sure what's happening now. @fweikert |
Hey Fabian, Great work, thank you! I'm working on a change that sets original_path for all existing versioned docs, then it should work. |
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.
The scripts also need to update _buttons.html to add the version selector for the new release.
Do you want me to do that? Not sure how as that change to the file would also need to be committed. |
Technically it should be enough to include the modified _buttons.html file in the zip file generated by //scripts/docs:gen_release_docs at the root level, and then the release scripts take care of committing it. But that's something we can do in the future. |
Probably that should be done in the same place as where |
There is a genrule that invokes a dedicated Java binary to update the TOC: https://github.com/bazelbuild/bazel/blob/master/scripts/docs/BUILD#L30 For _buttons.html we might get away with a simpler Python script. |
I updated the TOC updater to also update the version indicator. |
I added |
@fweikert Thanks! Is there anything else I should do or is this ready to be imported? |
We are importing this PR, nothing else needed, thanks!! |
The changes are live: https://bazel.build/versions/7.2.0/rules/lib/globals/build Thank you so much for fixing this! @fmeum 🙏🏼 |
The header of each docs page now indicates the current version in bold and contains links to the same page for each other release with versioned docs.
The template language usage in this change is based on publicly available information: https://github.com/GoogleCloudPlatform/DataflowTemplates/blob/97f69c065e9a049f43a5676b633d181ed0ac8448/plugins/core-plugin/src/main/resources/site-template.md?plain=1