-
Notifications
You must be signed in to change notification settings - Fork 894
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
Update navbar.html #95
Conversation
Add optional drop down list for versions
The actual drop down. Uses config.toml params which I'll need to document/add in the example site.
Fixes #30 once the change is documented. Requires a version_menu param and some [params.versions], as in the kubeflow config: |
Thanks @LisaFC! Please would you point me at a preview? I've looked at the preview generated by Netlify, and at the "Example Site" site that it points to, but neither of those has a version dropdown. |
@@ -0,0 +1,8 @@ | |||
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | |||
{{ .Site.Params.version_menu }} |
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 version_menu
parameter is not used by Kubeflow (and therefore renders blank). Is this a separate "menu only" value that you want set?
Kubeflow has a version
value that is used in each repo branch to indicate that site's version. In my testing, if i rename this to .Site.Params.version
, then it works as i initially expected (ie. i used below, and therefore the main nav bar showed master
next to the dropdown menu).
My example config.toml
version = "master"
githubbranch = "master"
# Add new release versions here
[[params.versions]]
version = "master"
githubbranch = "master"
url = "https://master.kubeflow.org"
[[params.versions]]
version = "v0.2"
githubbranch = "v0.2-branch"
url = "https://v0-2.kubeflow.org"
[[params.versions]]
version = "v0.3"
githubbranch = "v0.3-branch"
url = "https://v0-3.kubeflow.org"
[[params.versions]]
version = "v0.4"
githubbranch = "v0.4-branch"
url = "https://v0-4.kubeflow.org"
[[params.versions]]
version = "v0.5"
githubbranch = "v0.5-branch"
url = "https://v0-5.kubeflow.org"
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.
True, but I didn't make this change to be backwards compatible with Kubeflow's customizations (even though I borrowed from them), I made it to be backwards compatible with existing Docsy sites - I don't actually think having the current version name as the button/menu name is idea for all cases, especially if you look at some of the older "live" Kubeflow sites (https://v0-4.kubeflow.org/), they all just have a drop down called "master", which may not make it obvious what you can do with the menu. (unless this isn't the intended behaviour?) The equivalent menu in Agones is called Releases.
There's a separate menu name variable called version_menu, which I'll add to the example site config and the docs.
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 can demonstrate it in the example site but the menu wouldn't point to anything as we do not have any old versions....
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've also added a commit for the instructions.
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.
Sounds good. Thanks Lisa
Yeah, the preview won't work because the site in this theme repo doesn't have any previous versions specified so Hugo doesn't render the menu. Working as intended, but probably not a very good demo. :) I'll see if I can put something up on Netlify that has the menu by adding some fake old version URLs. It works fine locally. |
Here's it being previewed on another site: https://serene-roentgen-10fbaa.netlify.com/docs/ |
Documentation for version nav feature
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.
LGTM
Add optional drop down list for versions