summaryrefslogtreecommitdiffstats
path: root/layouts
diff options
context:
space:
mode:
authoranoduck <11767-anoduck@users.noreply.gitgud.io>2024-09-14 00:05:22 -0400
committeranoduck <11767-anoduck@users.noreply.gitgud.io>2024-09-14 00:05:22 -0400
commitfa287d08587aa6172149460eae4b243e78eb7494 (patch)
tree69a6352b3412aa12b52780f468f7c1b3670931cd /layouts
parent9744378a9b9071872182edb4f151f915ecfa8643 (diff)
updated theme colors
Diffstat (limited to 'layouts')
-rw-r--r--layouts/shortcodes/navbar.html55
1 files changed, 55 insertions, 0 deletions
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 @@
+<!--
+ Copyright © 2024 The Hinode Team / Mark Dumay. All rights reserved.
+ Use of this source code is governed by The MIT License (MIT) that can be found in the LICENSE file.
+ Visit gethinode.com/license for more details.
+-->
+
+{{ $error := false }}
+
+<!-- Validate arguments -->
+{{ if partial "utilities/IsInvalidArgs.html" (dict "structure" "navbar" "args" .Params "group" "shortcode") }}
+ {{ errorf "Invalid arguments: %s" .Position -}}
+ {{ $error = true }}
+{{ end }}
+
+<!-- Initialize arguments -->
+{{- $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 "" -}}
+
+<!-- Main code -->
+{{ 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