diff --git a/linkerd.io/layouts/partials/docs.html b/linkerd.io/layouts/partials/docs.html index f19d097414..bff9399a5d 100644 --- a/linkerd.io/layouts/partials/docs.html +++ b/linkerd.io/layouts/partials/docs.html @@ -1,7 +1,15 @@ {{ $latestVersion := site.Params.latest_linkerd2_stable_version }} -{{ $pathParts := split .page.Path "/" }} -{{ $docsVersion := index $pathParts 1 }} -{{ $latestDocsPath := delimit (append (after 2 $pathParts) (slice "" $latestVersion)) "/" }} +{{/* + By default, not all pages are backed by a file, including top level section + pages, so verifying file existence before processing `.Path` +*/}} +{{ $docsVersion := "" }} +{{ $latestDocsPath := "" }} +{{ with .page.File }} + {{ $pathParts := split .Path "/" }} + {{ $docsVersion = index $pathParts 0 }} + {{ $latestDocsPath = delimit (append (after 1 $pathParts) (slice "" $latestVersion)) "/" }} +{{ end }}