From: Arnaud Guéras Date: Sat, 30 Nov 2024 08:43:18 +0000 (+0100) Subject: fix blog link in footer X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=3afa466802378be4d3c7eac05a9790ec304e779b;p=www-xenproject-org.git fix blog link in footer Signed-off-by: Arnaud Guéras --- diff --git a/hugo.yaml b/hugo.yaml index a2c1efc..f237971 100644 --- 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/" diff --git a/themes/xen-project/layouts/partials/menu/walk.html b/themes/xen-project/layouts/partials/menu/walk.html index aa01e6b..374b3a5 100644 --- a/themes/xen-project/layouts/partials/menu/walk.html +++ b/themes/xen-project/layouts/partials/menu/walk.html @@ -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 -}} @@ -11,8 +12,10 @@ {{- 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 -}} + {{ $name }} {{- with .Children }}
    {{ partial "menu/walk.html" (dict "page" $page "menuEntries" . "isFooter" $isFooter) }}
{{- end -}}