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

Update navbar.html #95

Merged
merged 4 commits into from
Jul 2, 2019
Merged

Update navbar.html #95

merged 4 commits into from
Jul 2, 2019

Conversation

LisaFC
Copy link
Collaborator

@LisaFC LisaFC commented Jun 28, 2019

Add optional drop down list for versions

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.
@LisaFC
Copy link
Collaborator Author

LisaFC commented Jun 28, 2019

Fixes #30 once the change is documented.

Requires a version_menu param and some [params.versions], as in the kubeflow config:
https://github.com/kubeflow/website/blob/master/config.toml

@LisaFC
Copy link
Collaborator Author

LisaFC commented Jun 28, 2019

@sarahmaddox @markmandel

@sarahmaddox
Copy link
Contributor

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.

https://deploy-preview-95--docsydocs.netlify.com/

@@ -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 }}
Copy link
Contributor

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"

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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....

Copy link
Collaborator Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good. Thanks Lisa

layouts/partials/navbar.html Outdated Show resolved Hide resolved
@LisaFC
Copy link
Collaborator Author

LisaFC commented Jun 29, 2019

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.

https://deploy-preview-95--docsydocs.netlify.com/

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.

@LisaFC
Copy link
Collaborator Author

LisaFC commented Jul 1, 2019

Here's it being previewed on another site: https://serene-roentgen-10fbaa.netlify.com/docs/

Documentation for version nav feature
Copy link
Contributor

@RichieEscarez RichieEscarez left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants