diff --git a/themes/hugo-geekdoc/layouts/partials/menu-nextprev.html b/themes/hugo-geekdoc/layouts/partials/menu-nextprev.html
index 3997d6af0cc6df8f846ee4927a88dbd1b79cae00..b1fe8d34e2675516764b6a283f2bbedb413453f1 100644
--- a/themes/hugo-geekdoc/layouts/partials/menu-nextprev.html
+++ b/themes/hugo-geekdoc/layouts/partials/menu-nextprev.html
@@ -48,28 +48,17 @@
     {{ end }}
   {{ end }}
 {{ end }}
-
-{{ $showPrevNext := (and (default true .Site.Params.geekdocNextPrev) .Site.Params.geekdocMenuBundle) }}
+{{ $showPrevNext := and (default true .Site.Params.geekdocNextPrev) .Site.Params.geekdocMenuBundle }}
 {{ if $showPrevNext }}
   <span class="gdoc-page__nav">
     {{ with ($current.Scratch.Get "prevPage") }}
       <a
         class="gdoc-page__nav--prev flex align-center"
         href="{{ .this.RelPermalink }}"
-	title="{{ $type := (printf "%T" .name) }} 
-        {{ if eq $type "map[string]interface {}" }}
-        {{ (index .name $.Lang) }}
-        {{ else }}
-         {{ .name }}
-	{{ end }}"
+        title="{{ with .name }}{{ if eq (printf "%T" .) "map[string]interface {}" }}{{ index . $.Lang }}{{ else }}{{ . }}{{ end }}{{ end }}"
       >
         <i class="gdoc-icon">gdoc_arrow_left_alt</i>
-        {{ $type := (printf "%T" .name) }} 
-        {{ if eq $type "map[string]interface {}" }}
-        {{ (index .name $.Lang) }}
-        {{ else }}
-         {{ .name }}
-	{{ end }}
+        {{ with .name }}{{ if eq (printf "%T" .) "map[string]interface {}" }}{{ index . $.Lang }}{{ else }}{{ . }}{{ end }}{{ end }}
       </a>
     {{ end }}
   </span>
@@ -78,19 +67,9 @@
       <a
         class="gdoc-page__nav--next flex align-center"
         href="{{ .this.RelPermalink }}"
-	title="{{ $type := (printf "%T" .name) }} 
-        {{ if eq $type "map[string]interface {}" }}
-        {{ (index .name $.Lang) }}
-        {{ else }}
-         {{ .name }}
-	{{ end }}"
+        title="{{ with .name }}{{ if eq (printf "%T" .) "map[string]interface {}" }}{{ index . $.Lang }}{{ else }}{{ . }}{{ end }}{{ end }}"
       >
-        {{ $type := (printf "%T" .name) }} 
-        {{ if eq $type "map[string]interface {}" }}
-        {{ (index .name $.Lang) }}
-        {{ else }}
-         {{ .name }}
-	{{ end }}
+        {{ with .name }}{{ if eq (printf "%T" .) "map[string]interface {}" }}{{ index . $.Lang }}{{ else }}{{ . }}{{ end }}{{ end }}
         <i class="gdoc-icon">gdoc_arrow_right_alt</i>
       </a>
     {{ end }}