{{ $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 "" }}