diff --git a/docs/website/layouts/partials/docs/article.html b/docs/website/layouts/partials/docs/article.html index 0d70d545a8..49b30be800 100644 --- a/docs/website/layouts/partials/docs/article.html +++ b/docs/website/layouts/partials/docs/article.html @@ -1,9 +1,18 @@ {{ $releases := site.Data.releases }} +{{ $version := index (split .File.Path "/") 1 }} {{ $latest := printf "%s" (index $releases 1) }} -{{- if eq (len site.Data.releases) 1 -}} +{{- if eq (len $releases) 1 -}} {{- $latest = "(dev preview)" -}} {{- end -}} -{{ $version := index (split .File.Path "/") 1 }} + +{{ $rank := 1 }} +{{- range $index, $ver := $releases -}} + {{- if eq $ver $version -}} + {{ $rank = $index }} + {{- end -}} +{{- end -}} +{{ $ancient := gt $rank 5 }} +
{{- if (eq $version "edge") }}
@@ -12,7 +21,7 @@
{{- else if (and (ne $version "latest") (ne $version $latest)) }} -
+
These are the docs for an older version of OPA. Latest stable release is {{ $latest }}
diff --git a/docs/website/layouts/partials/docs/dashboard-panel.html b/docs/website/layouts/partials/docs/dashboard-panel.html index 79a74109df..352519565e 100644 --- a/docs/website/layouts/partials/docs/dashboard-panel.html +++ b/docs/website/layouts/partials/docs/dashboard-panel.html @@ -5,6 +5,14 @@ {{ $version := index (split .File.Path "/") 1 }} {{ $page := trim .RelPermalink "/" }} {{ $isLatest := or (eq $version $latest) (eq $version "latest") }} + +{{ $rank := 1 }} +{{- range $index, $ver := $releases -}} + {{- if eq $ver $version -}} + {{ $rank = $index }} + {{- end -}} +{{- end -}} +{{ $ancient := gt $rank 5 }}