From b63d34e6a048c9c3f58a103152eb9c3bdfdfa685 Mon Sep 17 00:00:00 2001 From: Jared Watts Date: Wed, 3 Sep 2025 12:20:06 -0700 Subject: [PATCH] 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 --- content/v2.0-preview/_index.md | 1 + .../partials/version-dropdown-menu.html | 21 +++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/content/v2.0-preview/_index.md b/content/v2.0-preview/_index.md index 03e4c10b..52ff1818 100644 --- a/content/v2.0-preview/_index.md +++ b/content/v2.0-preview/_index.md @@ -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 diff --git a/themes/geekboot/layouts/partials/version-dropdown-menu.html b/themes/geekboot/layouts/partials/version-dropdown-menu.html index 0653649b..168a516b 100644 --- a/themes/geekboot/layouts/partials/version-dropdown-menu.html +++ b/themes/geekboot/layouts/partials/version-dropdown-menu.html @@ -6,15 +6,18 @@ {{ 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 }}