From cd0279d2787bbf265e12e309b8a61489c727bb2a Mon Sep 17 00:00:00 2001 From: Brandon Date: Sat, 26 Oct 2024 19:51:38 -0400 Subject: create repo --- layouts/_default/baseof.html | 44 +++++++++++++++++++++++++++++++++++++++++ layouts/_default/single.html | 6 ++++++ layouts/index.html | 5 +++++ layouts/partials/footer.html | 1 + layouts/partials/head.html | 5 +++++ layouts/partials/head/css.html | 9 +++++++++ layouts/partials/head/js.html | 12 +++++++++++ layouts/partials/header.html | 10 ++++++++++ layouts/partials/langmenu.html | 5 +++++ layouts/partials/menu.html | 7 +++++++ layouts/partials/terms.html | 23 +++++++++++++++++++++ layouts/shortcodes/columns.html | 7 +++++++ layouts/shortcodes/icon.html | 4 ++++ 13 files changed, 138 insertions(+) create mode 100644 layouts/_default/baseof.html create mode 100644 layouts/_default/single.html create mode 100644 layouts/index.html create mode 100644 layouts/partials/footer.html create mode 100644 layouts/partials/head.html create mode 100644 layouts/partials/head/css.html create mode 100644 layouts/partials/head/js.html create mode 100644 layouts/partials/header.html create mode 100644 layouts/partials/langmenu.html create mode 100644 layouts/partials/menu.html create mode 100644 layouts/partials/terms.html create mode 100644 layouts/shortcodes/columns.html create mode 100644 layouts/shortcodes/icon.html (limited to 'layouts') diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..3a2c806 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,44 @@ + + + + + + + + + + {{ $title := site.Title }} + {{ if not .IsHome }} + {{ $title = printf "%s | %s" .Title site.Title }} + {{ end }} + + {{ $title }} + + + + +
+ +
+ {{ partial "menu.html" . }} +
+
+
+ + +
+
+ {{ block "main" . }}{{ end }} +
+
+ + + +
+
+ + + + diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..c7110a4 --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,6 @@ +{{ define "main" }} + +

{{ .Title }}

+{{ .Content }} + +{{ end }} diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..46c82c0 --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,5 @@ +{{ define "main" }} + +{{ .Content }} + +{{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..a7cd916 --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1 @@ +

Copyright {{ now.Year }}. All rights reserved.

diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..02c2240 --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1,5 @@ + + +{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }} +{{ partialCached "head/css.html" . }} +{{ partialCached "head/js.html" . }} diff --git a/layouts/partials/head/css.html b/layouts/partials/head/css.html new file mode 100644 index 0000000..91b928d --- /dev/null +++ b/layouts/partials/head/css.html @@ -0,0 +1,9 @@ +{{- with resources.Get "css/main.css" }} + {{- if eq hugo.Environment "development" }} + + {{- else }} + {{- with . | minify | fingerprint }} + + {{- end }} + {{- end }} +{{- end }} diff --git a/layouts/partials/head/js.html b/layouts/partials/head/js.html new file mode 100644 index 0000000..18fe842 --- /dev/null +++ b/layouts/partials/head/js.html @@ -0,0 +1,12 @@ +{{- with resources.Get "js/main.js" }} + {{- if eq hugo.Environment "development" }} + {{- with . | js.Build }} + + {{- end }} + {{- else }} + {{- $opts := dict "minify" true }} + {{- with . | js.Build $opts | fingerprint }} + + {{- end }} + {{- end }} +{{- end }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..31d8f14 --- /dev/null +++ b/layouts/partials/header.html @@ -0,0 +1,10 @@ +
+ +
+

{{ site.Title }}

+ {{ partial "menu.html" (dict "menuID" "main" "page" .) }} + {{ partial "langmenu.html" (dict "languages" .) }} +
+
+
+
diff --git a/layouts/partials/langmenu.html b/layouts/partials/langmenu.html new file mode 100644 index 0000000..356b8f2 --- /dev/null +++ b/layouts/partials/langmenu.html @@ -0,0 +1,5 @@ + diff --git a/layouts/partials/menu.html b/layouts/partials/menu.html new file mode 100644 index 0000000..bac3fe2 --- /dev/null +++ b/layouts/partials/menu.html @@ -0,0 +1,7 @@ + diff --git a/layouts/partials/terms.html b/layouts/partials/terms.html new file mode 100644 index 0000000..47cf6e4 --- /dev/null +++ b/layouts/partials/terms.html @@ -0,0 +1,23 @@ +{{- /* +For a given taxonomy, renders a list of terms assigned to the page. + +@context {page} page The current page. +@context {string} taxonomy The taxonony. + +@example: {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }} +*/}} + +{{- $page := .page }} +{{- $taxonomy := .taxonomy }} + +{{- with $page.GetTerms $taxonomy }} + {{- $label := (index . 0).Parent.LinkTitle }} +
+
{{ $label }}:
+ +
+{{- end }} diff --git a/layouts/shortcodes/columns.html b/layouts/shortcodes/columns.html new file mode 100644 index 0000000..536e87e --- /dev/null +++ b/layouts/shortcodes/columns.html @@ -0,0 +1,7 @@ +
+{{ range split .Inner "<--->" }} +{{ printf "
" | htmlUnescape | safeHTML }} +{{ . | safeHTML }} +{{ printf "
" | htmlUnescape | safeHTML }} +{{ end }} +
diff --git a/layouts/shortcodes/icon.html b/layouts/shortcodes/icon.html new file mode 100644 index 0000000..a61fac1 --- /dev/null +++ b/layouts/shortcodes/icon.html @@ -0,0 +1,4 @@ + + {{ .Get + + -- cgit v1.2.3