Adjust templates layout for hugo 0.146, potentially breaking change

This commit is contained in:
Alex Shpak
2025-05-31 01:38:33 +02:00
parent 24d3465980
commit f2c703e155
45 changed files with 5 additions and 11 deletions
+28
View File
@@ -0,0 +1,28 @@
<!--
This is template for hugo menus, accepts MenuEntity as context
https://gohugo.io/variables/menus/
-->
{{ if . }}
{{ template "book-menu-hugo" . }}
{{ end }}
{{ define "book-menu-hugo" }}
<ul>
{{ range . }}
<li>
<a href="{{ .URL }}" {{ with .Params.class }}class="{{ . }}"{{ end }} {{ if not .Page }}target="_blank" rel="noopener"{{ end }}>
{{- .Pre -}}
{{ with .Page }}
{{ partial "docs/title" .Page }}
{{ else }}
{{ .Name }}
{{ end }}
{{- .Post -}}
</a>
{{- with .Children }}
{{ template "book-menu-hugo" . }}
{{- end }}
</li>
{{ end }}
</ul>
{{ end }}