From fa287d08587aa6172149460eae4b243e78eb7494 Mon Sep 17 00:00:00 2001 From: anoduck <11767-anoduck@users.noreply.gitgud.io> Date: Sat, 14 Sep 2024 00:05:22 -0400 Subject: updated theme colors --- layouts/shortcodes/navbar.html | 55 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 layouts/shortcodes/navbar.html (limited to 'layouts/shortcodes') diff --git a/layouts/shortcodes/navbar.html b/layouts/shortcodes/navbar.html new file mode 100644 index 0000000..0139440 --- /dev/null +++ b/layouts/shortcodes/navbar.html @@ -0,0 +1,55 @@ + + +{{ $error := false }} + + +{{ if partial "utilities/IsInvalidArgs.html" (dict "structure" "navbar" "args" .Params "group" "shortcode") }} + {{ errorf "Invalid arguments: %s" .Position -}} + {{ $error = true }} +{{ end }} + + +{{- $id := .Get "id" | default (printf "navbar-collapse-%d" (add .Ordinal 1)) -}} +{{ $path := .Get "path" }} +{{ $page := "" }} +{{ if $path }}{{ $page = .Site.GetPage $path }}{{ end }} +{{ if and $path (not $page) }} + {{ errorf "Cannot find page '%s': %s" $path .Position -}} + {{ $error = true -}} +{{ end }} + +{{ $menus := .Get "menus" | default "main" -}} +{{ $size := .Get "size" | default "md" -}} +{{ $style := .Get "style" | default "dark" -}} +{{ $inverseStyle := "dark" -}} +{{ if eq $style "dark" }}{{ $inverseStyle = "light" }}{{ end -}} +{{ $color := .Get "color" | default "" -}} +{{ $searchParam := true -}} +{{ if isset .Params "search" }}{{ $searchParam = partial "utilities/CastBool.html" (.Get "search") }}{{ end -}} +{{ $modeParam := true -}} +{{ if isset .Params "mode" }}{{ $modeParam = partial "utilities/CastBool.html" (.Get "mode") }}{{ end -}} +{{ $logo := .Get "logo" | default "" -}} +{{ $title := .Get "title" | default "" -}} +{{- $class := .Get "class" | default "" -}} + + +{{ if not $error -}} + {{- partial "assets/navbar.html" (dict + "id" $id + "page" $page + "size" $size + "style" $style + "color" $color + "search" $searchParam + "mode" $modeParam + "menus" $menus + "logo" $logo + "title" $title + "class" $class + ) + -}} +{{ end -}} \ No newline at end of file -- cgit v1.2.3