From 49458f5ffd5a48c465117ec27f6437683f75acc1 Mon Sep 17 00:00:00 2001 From: Alexander Neonxp Kiryukhin Date: Sat, 31 Jan 2026 20:38:50 +0300 Subject: initial --- themes/neonxp/layouts/_partials/menu.html | 50 +++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 themes/neonxp/layouts/_partials/menu.html (limited to 'themes/neonxp/layouts/_partials/menu.html') diff --git a/themes/neonxp/layouts/_partials/menu.html b/themes/neonxp/layouts/_partials/menu.html new file mode 100644 index 0000000..ebad53f --- /dev/null +++ b/themes/neonxp/layouts/_partials/menu.html @@ -0,0 +1,50 @@ +{{- /* +Renders a menu for the given menu ID. + +@context {page} page The current page. +@context {string} menuID The menu ID. + +@example: {{ partial "menu.html" (dict "menuID" "main" "page" .) }} +*/}} + +{{- $page := .page }} +{{- $menuID := .menuID }} + +{{- with index site.Menus $menuID }} + +{{- end }} + +{{- define "_partials/inline/menu/walk.html" }} +{{- $page := .page }} +{{- range .menuEntries }} +{{- $attrs := dict "href" .URL }} +{{- 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 }} +{{- with .Identifier }} +{{- with T . }} +{{- $name = . }} +{{- end }} +{{- end }} +
  • + + {{if .Pre}} + {{.Pre}} + {{end}} + {{ $name }} + + {{- with .Children }} + + {{- end }} +
  • +{{- end }} +{{- end }} \ No newline at end of file -- cgit v1.2.3