Skip to content

Commit f07d604

Browse files
authored
docs: Set versioned docs links to point to archive (#7528)
In the version dropdown, v1.2.0 used to point to: https://www.openpolicyagent.org/docs/v1.2.0/ Now it'll point to the archived version for that release. https://v1-2-0--opa-docs.netlify.app/ This is being done as part of #7037 Signed-off-by: Charlie Egan <[email protected]>
1 parent 828b8cb commit f07d604

File tree

1 file changed

+18
-20
lines changed

1 file changed

+18
-20
lines changed

docs/website/layouts/partials/docs/dashboard-panel.html

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<div class="dashboard-panel left has-background-white-bis is-hidden-touch">
1717
<div class="dashboard-panel-header has-text-centered">
1818
<div class="dashboard-panel-header-logo">
19-
<a href="{{ $home }}">
19+
<a href="https://openpolicyagent.org">
2020
<img src="{{ $logo }}">
2121
</a>
2222
</div>
@@ -42,7 +42,7 @@
4242
pre-release
4343
</span>
4444
{{ else }}
45-
<span class="tag latest-tag {{ cond $ancient "is-danger" "is-warning"}} is-small has-text-weight-bold">
45+
<span class="tag latest-tag {{ cond $ancient " is-danger" "is-warning" }} is-small has-text-weight-bold">
4646
older
4747
</span>
4848
{{ end }}
@@ -54,27 +54,25 @@
5454

5555
<div class="dropdown-menu">
5656
<div class="dropdown-content has-text-left">
57-
{{ range $releases }}
58-
{{ if ne . "latest" }}
59-
{{ $isLatest := eq . (index site.Data.releases 1) }}
60-
{{ $verRef := . }}
61-
{{ if $isLatest }}
62-
{{ $verRef = "latest" }}
63-
{{ end }}
64-
{{ $versionedLink := strings.Replace $page $version $verRef }}
65-
{{ if (eq (site.GetPage $versionedLink).Content "") }}
66-
{{ $versionedLink = printf "docs/%s" $verRef }}
67-
{{ end }}
68-
<a href="{{ printf "/%s" $versionedLink }}" class="dropdown-item">
69-
{{ . }}
70-
{{ if $isLatest }}
71-
<span class="tag latest-tag is-success is-small has-text-weight-bold">
57+
{{ range $releases }}
58+
{{ if ne . "latest" }}
59+
{{ $isLatest := eq . (index site.Data.releases 1) }}
60+
{{ $verRef := . }}
61+
{{ if $isLatest }}
62+
{{ $verRef = "latest" }}
63+
{{ end }}
64+
{{ $versionSubdomain := strings.Replace . "." "-" }}
65+
{{ $versionedURL := printf "https://%s--opa-docs.netlify.app/" $versionSubdomain }}
66+
<a href="{{ $versionedURL }}" class="dropdown-item">
67+
{{ . }}
68+
{{ if $isLatest }}
69+
<span class="tag latest-tag is-success is-small has-text-weight-bold">
7270
latest
7371
</span>
74-
{{ end }}
75-
</a>
76-
{{ end }}
72+
{{ end }}
73+
</a>
7774
{{ end }}
75+
{{ end }}
7876
</div>
7977
</div>
8078
</div>

0 commit comments

Comments
 (0)