Skip to content
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

Make the navigation sidebar versioned #12708

Closed
wants to merge 1 commit into from

Conversation

jin
Copy link
Member

@jin jin commented Dec 16, 2020

Fixes: #6937

This adds versioning support to the navigation sidebar in the default documentation page layout, conditionally loading a sidebar partial based on the current version's major version, or use the latest one in the case for rolling releases. This also means that the navigation sidebar list is extracted out from the documentation.html layout file, into an include partial.

This gets rid of the many conditionals littered all over the navigation list items.

Currently, the biggest differences are between the groups of v0, v1-3, and master. This implementation allows v1 and v2's sidebar to just be a symlink to v3. For rolling releases, the sidebar is versioned as master.

% tree _includes/documentation-sidebar
_includes/documentation-sidebar
├── 0
│   └── sidebar.html
├── 1 -> 3
├── 2 -> 3
├── 3
│   └── sidebar.html
└── master
    └── sidebar.html

We can also allow finer-grained versioning with the full major.minor.patch, but I think major versions are a good enough start.

@google-cla google-cla bot added the cla: yes label Dec 16, 2020
@jin jin changed the title Make the navigation sidebar versioned according. Make the navigation sidebar versioned. Dec 16, 2020
@jin jin changed the title Make the navigation sidebar versioned. Make the navigation sidebar versioned Dec 16, 2020
Fixes: bazelbuild#6937

This adds versioning support to the navigation sidebar in the default documentation page layout, conditionally loading a sidebar partial based on the current version's major version, or use the latest one in the case for rolling releases.

This gets rid of the many conditionals littered all over the navigation list items.
@meisterT
Copy link
Member

Thanks for working on this Jin! What's the expected workflow on updating this? Should we add an item to https://github.com/bazelbuild/continuous-integration/blob/master/docs/release-playbook.md?

@jin
Copy link
Member Author

jin commented Dec 16, 2020

Depending on whether we want sidebars versioned on the major version or the full version, the release manager would just need to create a new symlink or new directory in the versioned sidebar doc.

Alternatively we have a generate_versioned_docs setup script, can probably add something in there..

@jin jin added the team-Documentation Documentation improvements that cannot be directly linked to other team labels label Dec 16, 2020
@jin jin self-assigned this Dec 17, 2020
Copy link
Contributor

@floriographygoth floriographygoth left a comment

Choose a reason for hiding this comment

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

LGTM.

@bazel-io bazel-io closed this in 467e1d4 Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes team-Documentation Documentation improvements that cannot be directly linked to other team labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Versioned Docs: the navigation sidebar should also be versioned
3 participants