mirror of
https://github.com/imfing/hextra.git
synced 2025-05-13 01:26:25 -04:00
Implement theme toggle in navbar.
- Add additional logic for navbar partial. - Uses a menu item params.type of `theme-toggle`. - Uses additional params.hideLabel boolean to set hideLabel for the theme-toggle.html partial.
This commit is contained in:
parent
86a1f3fd96
commit
ebdaf0fd4a
@ -31,6 +31,8 @@
|
||||
{{- range .Site.Menus.main -}}
|
||||
{{- if eq .Params.type "search" -}}
|
||||
{{- partial "search.html" (dict "params" .Params) -}}
|
||||
{{- else if eq .Params.type "theme-toggle" -}}
|
||||
{{- partial "theme-toggle.html" (dict "hideLabel" (.Params.hideLabel | default true)) -}}
|
||||
{{- else -}}
|
||||
{{- $link := .URL -}}
|
||||
{{- $external := strings.HasPrefix $link "http" -}}
|
||||
@ -67,4 +69,4 @@
|
||||
{{- partial "utils/icon.html" (dict "name" "hamburger-menu" "attributes" "height=24") -}}
|
||||
</button>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
Loading…
x
Reference in New Issue
Block a user