Skip to content

Commit c88a9a0

Browse files
Add releases tab with versioned links (#3217)
* Also needed to add releases back to navbar in the layouts. Co-authored-by: Austin Macdonald <[email protected]>
1 parent f4dff0d commit c88a9a0

File tree

4 files changed

+31
-12
lines changed

4 files changed

+31
-12
lines changed

hack/check-links.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ source ./hack/lib/common.sh
77
header_text "Building the site and checking links"
88
docker volume create sdk-html
99
docker run --rm -v "$(pwd):/src" -v sdk-html:/target klakegg/hugo:0.70.0-ext-ubuntu -s website
10-
docker run --rm -v sdk-html:/target mtlynch/htmlproofer /target --empty-alt-ignore --http-status-ignore 429
10+
docker run --rm -v sdk-html:/target mtlynch/htmlproofer /target --empty-alt-ignore --http-status-ignore 429 --allow_hash_href
1111
docker volume rm sdk-html

website/config.toml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,19 @@ github_repo = "https://github.com/operator-framework/operator-sdk"
7878

7979
[[params.versions]]
8080
version = "master"
81-
url = "/docs"
81+
url = "https://master.sdk.operatorframework.io"
8282

8383
[[params.versions]]
84-
version = "v0.16"
85-
url = "https://github.com/operator-framework/operator-sdk/tree/v0.16.x/doc"
84+
version = "Latest Release"
85+
url = "https://sdk.operatorframework.io"
8686

87+
[[params.versions]]
88+
version = "v0.18"
89+
url = "https://v0-18-x.sdk.operatorframework.io"
90+
91+
[[params.versions]]
92+
version = "v0.17"
93+
url = "https://github.com/operator-framework/operator-sdk/tree/v0.17.x/doc"
8794

8895
# Specify a value here if your content directory is not in your repo's root directory
8996
github_subdir = "website"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<a class="of-link-list__a nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
2+
{{ .Site.Params.version_menu }}
3+
</a>
4+
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
5+
{{ range .Site.Params.versions }}
6+
<a class="dropdown-item" href="{{ .url }}">{{ .version }}</a>
7+
{{ end }}
8+
</div>

website/layouts/partials/navbar.html

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,24 @@
22
<a href="/" class="of-brand">
33
<picture class="of-brand__picture">
44
<source srcset="/build/images/logo.svg" media="(min-width: 992px)">
5-
<img src="/build/images/logo-sm.svg" alt="">
6-
</picture>
5+
<img src="/build/images/logo-sm.svg" alt="">
6+
</picture>
77
</a>
88
<nav class="of-nav-main nav-collapse">
99
<ul class="of-nav-main__items menu-items">
1010
<li class="of-nav-main__item"><a class="of-link-list__a {{ if eq .URL "/" }} of-m-active {{end}}" href="/">Home</a></li>
1111
{{ $currentPage := . }}
12-
{{ range .Site.Menus.main }}
13-
<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>
14-
{{ end }}
15-
</ul>
12+
{{ range .Site.Menus.main }}
13+
<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>
14+
{{ end }}
15+
{{ if .Site.Params.versions }}
16+
<li class="of-nav-main__item">
17+
{{ partial "navbar-version-selector.html" . }}
18+
</li>
19+
{{ end }}
20+
</ul>
1621
</nav>
17-
1822
<div class="of-header-main__search">
1923
{{ partial "search-input.html" . }}
2024
</div>
21-
</header>
25+
</header>

0 commit comments

Comments
 (0)