Skip to content
Snippets Groups Projects
Unverified Commit d9d3a067 authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

fallback menu

parent 76b07ad3
No related branches found
No related tags found
No related merge requests found
{{ $kind := . }}
{{ $menus := index site.Data.menus (printf "%s" site.Language) }}
{{ $menu := index $menus $kind }}
{{ $menu := "" }}
// Try to get menus from the data/menus/<lang> directory
{{ if (and $menus (isset $menus $kind)) }}
// Menu found in data/menus/<lang>
{{ $menu = index $menus $kind }}
{{ else }}
// Fallback to menu in the data/menus directory
{{ $menu = index site.Data.menus $kind }}
{{ end }}
{{ return $menu }}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment