]> xenbits.xensource.com Git - www-xenproject-org.git/commitdiff
fix blog link in footer
authorArnaud Guéras <arnaudgs@gmail.com>
Sat, 30 Nov 2024 08:43:18 +0000 (09:43 +0100)
committerArnaud Guéras <arnaudgs@gmail.com>
Sat, 30 Nov 2024 08:43:18 +0000 (09:43 +0100)
Signed-off-by: Arnaud Guéras <arnaudgs@gmail.com>
hugo.yaml
themes/xen-project/layouts/partials/menu/walk.html

index a2c1efc37c2b3cb0680c7fe02ea22fec9b86271b..f23797197545aa1bd450e097c6561e169162e8cf 100644 (file)
--- a/hugo.yaml
+++ b/hugo.yaml
@@ -83,9 +83,10 @@ menus:
       weight: 60
       url: "/blog"
 
-    - name: "Blog"
+    - name: "BlogReleases"
       parent: "More"
       params:
+        altTitle: "Releases" 
         header: false
       weight: 61
       url: "/blog/tag/releases/"
index aa01e6b66b479e0c678f2d0b780fd00300489c45..374b3a5d050994f1adbce8ac8d48a79dfba1411d 100644 (file)
@@ -3,6 +3,7 @@
 {{- range .menuEntries -}}
   {{- $header := .Params.header | default true -}}
   {{- $footer := .Params.footer | default true -}}
+  {{- $altTitle := .Params.altTitle | default "" -}}
 
   {{- $shouldDisplay := or (and $isFooter $footer) (and (not $isFooter) $header) -}}
   {{- if $shouldDisplay -}}
       {{- if .Params.target -}}{{- $attrs = merge $attrs (dict "target" .Params.target) -}}{{- end -}}
       {{- if $page.IsMenuCurrent .Menu . -}}{{- $attrs = merge $attrs (dict "class" "active" "aria-current" "page") -}}
       {{- else if $page.HasMenuCurrent .Menu . -}}{{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") -}}{{- end -}}
-      {{- $name := .Name | safeHTML -}}
-      {{- with .Identifier -}}{{- with T . -}}{{- $name = . | safeHTML -}}{{- end -}}{{- end -}}
+
+      
+      {{- $name := cond (ne $altTitle "") $altTitle .Name | safeHTML -}}
+
       <a{{- range $k, $v := $attrs -}}{{- with $v }} {{ printf "%s=%q" $k $v | safeHTMLAttr }}{{- end -}}{{- end -}}>{{ $name }}</a>
       {{- with .Children }}<ul>{{ partial "menu/walk.html" (dict "page" $page "menuEntries" . "isFooter" $isFooter) }}</ul>{{- end -}}
     </li>