diff --git a/layouts/partials/function/currentMenuItem.html b/layouts/partials/function/currentMenuItem.html new file mode 100644 index 0000000..d728f0d --- /dev/null +++ b/layouts/partials/function/currentMenuItem.html @@ -0,0 +1,15 @@ +{{- $currentPage := . -}} + +{{- $name := "" -}} +{{- $id := -1 -}} + +{{- range site.Menus.main -}} + {{ $menu_item_url := .URL | relLangURL }} + {{ $page_url:= $currentPage.RelPermalink | relLangURL }} + {{ if eq $menu_item_url $page_url }} + {{- $name = .Identifier -}} + {{- $id = .Weight -}} + {{- end -}} +{{- end -}} + +{{- return (dict "Name" $name "ID" $id) -}}