Skip to content

Add versioned documents #30

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

Merged
merged 1 commit into from
Sep 15, 2020
Merged
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
54 changes: 33 additions & 21 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,40 @@ copyright = "The Operator Lifecycle Manager Authors"

# Menu title if your navbar has a versions selector to access old versions of your site.
# This menu appears only if you have at least one [params.versions] set.
# version_menu = "Releases"
# [[params.versions]]
# version = "master"
# url = "/docs"
version_menu = "Releases"

# [[params.versions]]
# version = "v0.16"
# url = "https://github.com/operator-framework/operator-sdk/tree/v0.16.x/doc"
# Repository configuration (URLs for in-page links to opening issues and suggesting changes)
github_repo = "https://github.com/operator-framework/olm-docs"
# An optional link to a related project repo. For example, the sibling repository where your product code lives.
github_project_repo = "https://github.com/operator-framework/operator-lifecycle-manager"

# Specify a value here if your content directory is not in your repo's root directory
# github_subdir = ""

# Google Custom Search Engine ID. Remove or comment out to disable search.
gcs_engine_id = "011737558837375720776:fsdu1nryfng"

# Enable Algolia DocSearch
algolia_docsearch = false

# version configuration

[[params.versions]]
version = "master"
url = "https://olm.operatorframework.io"
primary = true

[[params.versions]]
version = "v0.15.z"
url = "https://v0-15-x.olm.operatorframework.io/"

[[params.versions]]
version = "v0.14.z"
url = "https://v0-14-x.olm.operatorframework.io/"

[[params.versions]]
version = "v0.13.z"
url = "https://v0-13-x.olm.operatorframework.io/"

# 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.
Expand All @@ -93,20 +119,6 @@ copyright = "The Operator Lifecycle Manager Authors"
# point people to the main doc site.
# url_latest_version = "https://example.com"

# Repository configuration (URLs for in-page links to opening issues and suggesting changes)
github_repo = "https://github.com/operator-framework/olm-docs"
# An optional link to a related project repo. For example, the sibling repository where your product code lives.
github_project_repo = "https://github.com/operator-framework/operator-lifecycle-manager"

# Specify a value here if your content directory is not in your repo's root directory
# github_subdir = ""

# Google Custom Search Engine ID. Remove or comment out to disable search.
gcs_engine_id = "011737558837375720776:fsdu1nryfng"

# Enable Algolia DocSearch
algolia_docsearch = false

# User interface configuration
[params.ui]
# Enable to show the side bar menu in its compact state.
Expand Down
8 changes: 8 additions & 0 deletions layouts/partials/navbar-version-selector.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<a class="of-link-list__a nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{ .Site.Params.version_menu }}
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
{{ range .Site.Params.versions }}
<a class="dropdown-item" href="{{ .url }}">{{ .version }}</a>
{{ end }}
</div>
25 changes: 25 additions & 0 deletions layouts/partials/navbar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<header class="of-header-main">
<a href="/" class="of-brand">
<picture class="of-brand__picture">
<source srcset="/images/logo.svg" media="(min-width: 992px)">
<img src="/images/logo-sm.svg" alt="">
</picture>
</a>
<nav class="of-nav-main nav-collapse">
<ul class="of-nav-main__items menu-items">
<li class="of-nav-main__item"><a class="of-link-list__a {{ if eq .URL "/" }} of-m-active {{end}}" href="/">Home</a></li>
{{ $currentPage := . }}
{{ range .Site.Menus.main }}
<li class="of-nav-main__item"><a class="of-link-list__a{{if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} of-m-active{{end}}" href="{{ .URL }}" title="{{ .Title }}">{{ .Name }}</a></li>
{{ end }}
{{ if .Site.Params.versions }}
<li class="of-nav-main__item">
{{ partial "navbar-version-selector.html" . }}
</li>
{{ end }}
</ul>
</nav>
<div class="of-header-main__search">
{{ partial "search-input.html" . }}
</div>
</header>