{{/*
A version of the navbar.html partial in Docsy, only modified
to include the spec version, which is calculated using an
inline `version-string` partial.
*/}}
{{ $cover := .HasShortcode "blocks/cover" }}
{{ define "partials/version-selector" }}
{{ $version := .Site.Params.version }}
{{ $current := partial "current-version-short" . }}
{{ end }}
{{ define "partials/current-version-long" }}
{{ if eq .Site.Params.version.status "unstable" }}
unstable version
{{ else }}
version {{ partial "current-version-short" . }}
{{ end }}
{{ end }}
{{ define "partials/current-version-short" }}
{{ $ret := "unstable"}}
{{ if ne .Site.Params.version.status "unstable"}}
{{/* produces a string similar to "version v1.5" */}}
{{ $ret = delimit (slice "v" .Site.Params.version.major "." .Site.Params.version.minor) "" }}
{{ end }}
{{ return $ret }}
{{ end }}