mirror of
https://github.com/imfing/hextra.git
synced 2025-05-13 04:36:26 -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 -}}
|
{{- range .Site.Menus.main -}}
|
||||||
{{- if eq .Params.type "search" -}}
|
{{- if eq .Params.type "search" -}}
|
||||||
{{- partial "search.html" (dict "params" .Params) -}}
|
{{- partial "search.html" (dict "params" .Params) -}}
|
||||||
|
{{- else if eq .Params.type "theme-toggle" -}}
|
||||||
|
{{- partial "theme-toggle.html" (dict "hideLabel" (.Params.hideLabel | default true)) -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- $link := .URL -}}
|
{{- $link := .URL -}}
|
||||||
{{- $external := strings.HasPrefix $link "http" -}}
|
{{- $external := strings.HasPrefix $link "http" -}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user