{{ $pageDir := index (split (path.Dir .Page.RelPermalink) "/") 1 }}
{{ if or (eq $pageDir "docs") (eq $pageDir "") }}
{{ $pageDir = printf "%s.%s" ( index ( split .Site.Params.latest_release_version "." ) 0 ) ( index ( split .Site.Params.latest_release_version "." ) 1 ) }}
{{ end }}
{{ $pagePath := replace .Page.RelPermalink "docs" "" }}
{{ $pagePath = replace $pagePath $pageDir "" }}
{{ $pageDir }} {{ if eq (index .Site.Params.versions 0) $pageDir }} (latest) {{ end }}