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

Improve version selector & rename "master" to "latest" #3863

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 24 additions & 35 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -133,24 +133,33 @@ enable = true
# Google Custom Search Engine ID.
gcs_engine_id = "007239566369470735695:624rglujm-w"

# Text label for the version menu in the top bar of the website.
version_menu = "Version"
# The text label for the version menu in the top bar.
# The value depends on the branch:
# - `master` -> "Versions"
# - `v1.0-branch` -> "v1.0"
version_menu = "Versions"

# The major.minor version tag for the version of the docs represented in this
# branch of the repository. Used in the "version-banner" partial to display a
# version number for this doc set.
version = "master"
# The version of the docs. This is used in the "version-banner" partial.
# The value depends on the branch:
# - `master` -> "REPLACE_WITH_VERSION_ON_ARCHIVE"
# - `v1.0-branch` -> "v1.0"
version = "REPLACE_WITH_VERSION_ON_ARCHIVE"

# Flag used in the "version-banner" partial to decide whether to display a
# banner on every page indicating that this is an archived version of the docs.
# If the "version-banner" partial should display at the top of each page.
# The value depends on the branch:
# - `master` -> false
# - `v*-branch` -> true
archived_version = false

# A link to latest version of the docs. Used in the "version-banner" partial to
# point people to the main doc site.
url_latest_version = "https://kubeflow.org/docs/"
# The URL of the latest version of the docs.
# Used in the "version-banner" partial.
url_latest_version = "https://www.kubeflow.org/docs/"

# A variable used in various docs to determine URLs for config files etc.
# To find occurrences, search the repo for 'params "githubbranch"'.
# The GitHub branch for the current version of the docs.
# Used to generate the "Edit this page" link.
# The value depends on the branch:
# - `master` -> "master"
# - `v1.0-branch` -> "v1.0-branch"
github_branch = "master"

# Disable MathJax by default
Expand All @@ -169,9 +178,9 @@ enable = true

# These entries appear in the drop-down menu at the top of the website.
[[params.versions]]
version = "master"
version = "Latest"
githubbranch = "master"
url = "https://master.kubeflow.org"
url = "https://www.kubeflow.org"
[[params.versions]]
version = "v1.9"
githubbranch = "v1.9-branch"
Expand Down Expand Up @@ -212,26 +221,6 @@ enable = true
version = "v1.0"
githubbranch = "v1.0-branch"
url = "https://v1-0-branch.kubeflow.org"
[[params.versions]]
version = "v0.7"
githubbranch = "v0.7-branch"
url = "https://v0-7.kubeflow.org"
[[params.versions]]
version = "v0.6"
githubbranch = "v0.6-branch"
url = "https://v0-6.kubeflow.org"
[[params.versions]]
version = "v0.5"
githubbranch = "v0.5-branch"
url = "https://v0-5.kubeflow.org"
[[params.versions]]
version = "v0.4"
githubbranch = "v0.4-branch"
url = "https://v0-4.kubeflow.org"
[[params.versions]]
version = "v0.3"
githubbranch = "v0.3-branch"
url = "https://v0-3.kubeflow.org"

# User interface configuration
[params.ui]
Expand Down
33 changes: 33 additions & 0 deletions layouts/partials/version-banner.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!-- Check the variable that indicates whether this is an archived doc set. If yes, display a banner. -->
{{- $latest_version_url := .Site.Params.url_latest_version }}
{{- $current_version := replace .Site.Params.version "v" "" | markdownify }}
{{- if .Site.Params.archived_version }}
<style>
.version-banner {
padding: 1.5rem;
margin: 2rem 0;
max-width: 40rem;
border-style: solid;
border-color: #f0ad4e;
background-color: #faf5b6;
border-radius: 0.25rem;
}
.version-banner h3 {
margin-top: 0;
margin-bottom: 0.6em;
font-size: 1.25em;
}
.version-banner p {
margin-top: 0;
margin-bottom: 0;
}
</style>
<div class="version-banner">
<h3>You are viewing documentation for <strong>Kubeflow {{ $current_version }}</strong></h3>
<p>
This is a static snapshot from the time of the Kubeflow {{ $current_version }} release.
<br>
For up-to-date information, see the <a href="{{ $latest_version_url | safeURL }}">latest version</a>.
</p>
</div>
{{- end }}