mirror of https://github.com/crossplane/docs.git
feat: add ability to mark versions as hidden
We want to continue serving the v2.0-preview content (there are a lot of links to it floating around out there), but it is very confusing to see it in the drop down. This commit marks the v2.0-preview version as hidden from the version drop down selector, while still serving them in the case someone uses the direct URL. Signed-off-by: Jared Watts <jbw976@gmail.com>
This commit is contained in:
parent
84131c1ffb
commit
b63d34e6a0
|
@ -3,6 +3,7 @@ title: "Welcome"
|
|||
weight: -1
|
||||
cascade:
|
||||
version: "2.0-preview"
|
||||
hidden: true
|
||||
---
|
||||
|
||||
Welcome to the Crossplane documentation. Crossplane is a control plane framework
|
||||
|
|
|
@ -6,15 +6,18 @@
|
|||
|
||||
<!-- get all the versions and break out semver order -->
|
||||
{{ range .Site.Sections }}
|
||||
{{ if eq .Page.Params.version "master" }}
|
||||
{{$sorted_list = $sorted_list | append "master" }}
|
||||
{{ else if ne .Page.Params.version nil }}
|
||||
{{ $splitver := split .Page.Params.version "." }}
|
||||
{{ if eq (len $splitver) 2 }}
|
||||
{{ $verlist := (index $majordict (index $splitver 0)) }}
|
||||
{{ $verlist = $verlist | append (index $splitver 1) }}
|
||||
{{ $majordict = merge $majordict (dict (index $splitver 0) $verlist) }}
|
||||
{{ $majorlist = $majorlist | append (index $splitver 0) }}
|
||||
{{/* Skip versions marked as hidden */}}
|
||||
{{ if not .Page.Params.hidden }}
|
||||
{{ if eq .Page.Params.version "master" }}
|
||||
{{$sorted_list = $sorted_list | append "master" }}
|
||||
{{ else if ne .Page.Params.version nil }}
|
||||
{{ $splitver := split .Page.Params.version "." }}
|
||||
{{ if eq (len $splitver) 2 }}
|
||||
{{ $verlist := (index $majordict (index $splitver 0)) }}
|
||||
{{ $verlist = $verlist | append (index $splitver 1) }}
|
||||
{{ $majordict = merge $majordict (dict (index $splitver 0) $verlist) }}
|
||||
{{ $majorlist = $majorlist | append (index $splitver 0) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
Loading…
Reference in New Issue