diff --git a/layouts/partials/BaseName.hugo b/layouts/partials/BaseName.hugo new file mode 100644 index 0000000000..a383b7e602 --- /dev/null +++ b/layouts/partials/BaseName.hugo @@ -0,0 +1,2 @@ +{{- $ret := path.Base (strings.TrimSuffix (path.Ext .) .) }} +{{- return $ret }} \ No newline at end of file diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 68fa8cf10b..b8093d5c86 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -3,7 +3,7 @@ {{- $outputFormat := partial "output-format.hugo" (dict "page" . "format" $format) }} {{- $basename := "index" }} {{- if eq $outputFormat "searchpage" }} - {{- $basename = path.BaseName $format.RelPermalink }} + {{- $basename = partial "BaseName.hugo" $format.RelPermalink }} {{- end }} diff --git a/layouts/partials/menu.html b/layouts/partials/menu.html index a374a29e50..edc3b17bef 100644 --- a/layouts/partials/menu.html +++ b/layouts/partials/menu.html @@ -4,7 +4,7 @@ {{- $outputFormat := partial "output-format.hugo" (dict "page" . "format" $format) }} {{- $basename := "index" }} {{- if ne $outputFormat "html" }} - {{- $basename = path.BaseName $format.RelPermalink }} + {{- $basename = partial "BaseName.hugo" $format.RelPermalink }} {{- end }}