{{/* Determine which documentation version the current page belongs to, from its path (e.g. /v0.18/docs/... or /zh-cn/v0.18/docs/...); defaults to "main". */}} {{ $current := "main" }} {{ range .Site.Params.versions }} {{ if and (ne .version "main") (in $.RelPermalink (printf "/%s/" .version)) }} {{ $current = .version }} {{ end }} {{ end }} {{ .Site.Params.version_menu }}: {{ $current }}