feat: translate the site in french
This commit is contained in:
parent
3e98ac15b6
commit
b47b193b20
81 changed files with 1327 additions and 251 deletions
62
layouts/_partials/menu.html
Normal file
62
layouts/_partials/menu.html
Normal file
|
@ -0,0 +1,62 @@
|
|||
{{- /*
|
||||
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 }}
|
||||
{{- $menuClass := .class }}
|
||||
|
||||
{{- with index site.Menus $menuID }}
|
||||
<ul class="{{ $menuClass }}">
|
||||
{{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
|
||||
</ul>
|
||||
{{- end }}
|
||||
|
||||
{{- define "_partials/inline/menu/walk.html" }}
|
||||
{{- $page := .page }}
|
||||
{{- range .menuEntries }}
|
||||
{{- $attrs := dict "href" .URL "class" "" }}
|
||||
{{- 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 }}
|
||||
{{- $attrs = merge $attrs (dict "class" (print $attrs.class " contrast")) }}
|
||||
{{- if (ne .Params.class nil) }}
|
||||
{{- $attrs = merge $attrs (dict "class" (print $attrs.class " " .Params.class)) }}
|
||||
{{- end }}
|
||||
{{- if (ne .Params.rel nil) }}
|
||||
{{- $attrs = merge $attrs (dict "rel" .Params.rel) }}
|
||||
{{- end }}
|
||||
{{- $name := .Name }}
|
||||
{{- with .Identifier }}
|
||||
{{- with T . }}
|
||||
{{- $name = . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
<li>
|
||||
<a
|
||||
{{- range $k, $v := $attrs }}
|
||||
{{- with $v }}
|
||||
{{- printf " %s=%q" $k $v | safeHTMLAttr }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
>
|
||||
{{- if (ne .Params.iconName nil) }}
|
||||
{{partial "icon.html" (dict "icon" .Params.iconName "label" .Params.iconTitle)}}
|
||||
{{- end }}
|
||||
{{ $name }}
|
||||
</a>
|
||||
{{- with .Children }}
|
||||
<ul>
|
||||
{{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
|
||||
</ul>
|
||||
{{- end }}
|
||||
</li>
|
||||
{{- end }}
|
||||
{{- end }}
|
Loading…
Add table
Add a link
Reference in a new issue