From 4e969b7d3d38229b967c8a2a5bda8ef8749e0420 Mon Sep 17 00:00:00 2001 From: Arnaud Levy Date: Thu, 12 Feb 2026 23:59:58 +0100 Subject: [PATCH 01/15] refactor --- layouts/partials/commons/menu-dropdown.html | 41 ------ layouts/partials/commons/menu.html | 131 ++++-------------- layouts/partials/commons/menu/dropdown.html | 38 +++++ .../menu/helpers/GetSummary} | 0 layouts/partials/commons/menu/i18n.html | 12 ++ layouts/partials/commons/menu/li.html | 70 ++++++++++ layouts/partials/commons/menu/li/title.html | 16 +++ layouts/partials/commons/menu/search.html | 5 + layouts/partials/commons/menu/submenu.html | 17 +++ layouts/partials/commons/menu/ul.html | 19 +++ layouts/partials/footer/legals.html | 2 +- layouts/partials/footer/social.html | 2 +- layouts/partials/header/header.html | 4 +- 13 files changed, 206 insertions(+), 151 deletions(-) delete mode 100644 layouts/partials/commons/menu-dropdown.html create mode 100644 layouts/partials/commons/menu/dropdown.html rename layouts/partials/{GetMenuSummary => commons/menu/helpers/GetSummary} (100%) create mode 100644 layouts/partials/commons/menu/i18n.html create mode 100644 layouts/partials/commons/menu/li.html create mode 100644 layouts/partials/commons/menu/li/title.html create mode 100644 layouts/partials/commons/menu/search.html create mode 100644 layouts/partials/commons/menu/submenu.html create mode 100644 layouts/partials/commons/menu/ul.html diff --git a/layouts/partials/commons/menu-dropdown.html b/layouts/partials/commons/menu-dropdown.html deleted file mode 100644 index 700692644..000000000 --- a/layouts/partials/commons/menu-dropdown.html +++ /dev/null @@ -1,41 +0,0 @@ -{{- $parent := .parent -}} -{{- $level := .level -}} -{{- $options := .options -}} -{{- $level_options := index $options (printf "level_%d" $level) -}} -{{- $slug := anchorize .parent.title -}} -{{- $submenu := .submenu -}} -{{- $class := "dropdown-menu" -}} - -{{ if $level_options.title.active }} - {{ $class = printf "%s is-titled" $class }} -{{ end }} - -
- {{- with $level_options.title }} - {{ if .active }} -
- - - {{ $submenu }} -
- {{ else -}} - {{ $submenu }} - {{ end -}} - {{ end }} -
diff --git a/layouts/partials/commons/menu.html b/layouts/partials/commons/menu.html index c4adc2e00..64a6c17f9 100644 --- a/layouts/partials/commons/menu.html +++ b/layouts/partials/commons/menu.html @@ -1,114 +1,33 @@ {{ $kind := .kind }} +{{ $dropdown := .dropdown }} {{ $items := .items }} {{ $context := .context }} -{{ if $kind }} - {{ $menu := partial "GetMenu" $kind }} - {{ $items = $menu.items }} -{{ end }} -{{- $level := .level -}} -{{- $stop := .stop -}} - {{ $options := .options }} -{{ if $kind }} - {{- $options = index site.Params.menu $kind -}} -{{ end }} -{{- $level_options := index $options (printf "level_%d" $level) -}} -{{- $dropdown := .dropdown -}} - -