From cd0279d2787bbf265e12e309b8a61489c727bb2a Mon Sep 17 00:00:00 2001 From: Brandon Date: Sat, 26 Oct 2024 19:51:38 -0400 Subject: create repo --- 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 +++++++++++++++++++++++ 8 files changed, 72 insertions(+) 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 (limited to 'layouts/partials') 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 }} -- cgit v1.2.3