From aad72ed12cf1d07da1da9d7ebb5023943c12fd12 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Fri, 3 Jan 2025 10:21:25 -0500 Subject: [PATCH] Various template improvements --- themes/red/layouts/_default/art-nsfw.html | 3 +++ themes/red/layouts/_default/art-originals.html | 6 ++++-- themes/red/layouts/_default/arttag.html | 5 ++++- themes/red/layouts/_default/baseof.html | 6 +++++- themes/red/layouts/_default/character.html | 3 +++ themes/red/layouts/_default/guestart.html | 6 ++++-- themes/red/layouts/_default/year-gallery.html | 2 ++ themes/red/layouts/partials/gallery-js.html | 6 +++--- themes/red/layouts/partials/head.html | 15 +++++++++++++++ 9 files changed, 43 insertions(+), 9 deletions(-) diff --git a/themes/red/layouts/_default/art-nsfw.html b/themes/red/layouts/_default/art-nsfw.html index bf3d195..19bdc42 100644 --- a/themes/red/layouts/_default/art-nsfw.html +++ b/themes/red/layouts/_default/art-nsfw.html @@ -14,6 +14,9 @@ {{ $.Scratch.Set "paginator" (.Paginate $nsfw_art) }} {{ partial "art-gallery" . }} +{{ end }} +{{ define "head" }} {{ partial "gallery-js" . }} {{ end }} + diff --git a/themes/red/layouts/_default/art-originals.html b/themes/red/layouts/_default/art-originals.html index d3da585..aaad69c 100644 --- a/themes/red/layouts/_default/art-originals.html +++ b/themes/red/layouts/_default/art-originals.html @@ -16,11 +16,13 @@ {{ $.Scratch.Set "paginator" (.Paginate $originals) }} {{ partial "art-gallery" . }} - - {{ partial "gallery-js" . }} {{ end }} {{ define "details" }} {{ partial "art-sidebar" . }} {{ end }} +{{ define "head" }} + {{ partial "gallery-js" . }} +{{ end }} + diff --git a/themes/red/layouts/_default/arttag.html b/themes/red/layouts/_default/arttag.html index 57afe73..33074fb 100644 --- a/themes/red/layouts/_default/arttag.html +++ b/themes/red/layouts/_default/arttag.html @@ -5,9 +5,12 @@ {{ $.Scratch.Set "paginator" (.Paginate $artworks) }} {{ partial "art-gallery" . }} - {{ partial "gallery-js" . }} {{ end }} {{ define "details" }} {{ partial "art-sidebar" . }} {{ end }} + +{{ define "head" }} + {{ partial "gallery-js" . }} +{{ end }} diff --git a/themes/red/layouts/_default/baseof.html b/themes/red/layouts/_default/baseof.html index 18dedc3..6fc0c1d 100644 --- a/themes/red/layouts/_default/baseof.html +++ b/themes/red/layouts/_default/baseof.html @@ -1,6 +1,10 @@ - {{- partial "head.html" . -}} + + {{- partial "head.html" . -}} + + {{- block "head" . }}{{- end }} +
{{- partial "header.html" . -}}
diff --git a/themes/red/layouts/_default/character.html b/themes/red/layouts/_default/character.html index 27bec98..76f6763 100644 --- a/themes/red/layouts/_default/character.html +++ b/themes/red/layouts/_default/character.html @@ -44,6 +44,9 @@
{{ end }} +{{ end }} +{{ define "head" }} {{ partial "gallery-js" . }} {{ end }} + diff --git a/themes/red/layouts/_default/guestart.html b/themes/red/layouts/_default/guestart.html index 58161dc..dd83c5a 100644 --- a/themes/red/layouts/_default/guestart.html +++ b/themes/red/layouts/_default/guestart.html @@ -10,10 +10,12 @@ {{ $.Scratch.Set "paginator" (.Paginate ((where (where .RegularPagesRecursive "Type" "art") "Params.guest" "=" true))) }} {{ partial "art-gallery" . }} - - {{ partial "gallery-js" . }} {{ end }} {{ define "details" }} {{ partial "art-sidebar" . }} {{ end }} + +{{ define "head" }} + {{ partial "gallery-js" . }} +{{ end }} diff --git a/themes/red/layouts/_default/year-gallery.html b/themes/red/layouts/_default/year-gallery.html index d5402bf..b494e67 100644 --- a/themes/red/layouts/_default/year-gallery.html +++ b/themes/red/layouts/_default/year-gallery.html @@ -18,6 +18,8 @@ {{ end }} +{{ end }} +{{ define "head" }} {{ partial "gallery-js" . }} {{ end }} diff --git a/themes/red/layouts/partials/gallery-js.html b/themes/red/layouts/partials/gallery-js.html index f7f7653..7cd6e83 100644 --- a/themes/red/layouts/partials/gallery-js.html +++ b/themes/red/layouts/partials/gallery-js.html @@ -4,16 +4,16 @@ {{ if hugo.IsProduction }} {{ $masonry = $masonry | fingerprint | resources.PostProcess }} {{ end }} - + {{ $imagesloaded := resources.Get "js/imagesloaded.min.js" }} {{ if hugo.IsProduction }} {{ $imagesloaded = $imagesloaded | fingerprint | resources.PostProcess }} {{ end }} - + {{ $site := resources.Get "js/gallery.js" }} {{ if hugo.IsProduction }} {{ $site = $site | minify | fingerprint | resources.PostProcess }} {{ end }} - + diff --git a/themes/red/layouts/partials/head.html b/themes/red/layouts/partials/head.html index 243e38b..dd8ffb8 100644 --- a/themes/red/layouts/partials/head.html +++ b/themes/red/layouts/partials/head.html @@ -16,6 +16,7 @@ {{ end }} + {{ $style := resources.Get "css/site.css" }} {{ if hugo.IsProduction }} @@ -35,5 +36,19 @@ {{ end }} + + + + + {{ with .Params.tags }} + {{ $tags := delimit . "," }} + + {{ end }} + {{ with .Params.arttags }} + {{ $tags := delimit . "," }} + + {{ end }} + + {{ partial "opengraph.html" . }}