Skip to content

Commit

Permalink
feat: pass gallery params to JS
Browse files Browse the repository at this point in the history
  • Loading branch information
nicokaiser committed Nov 4, 2024
1 parent 4e04e63 commit 5725be6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions exampleSite/config/_default/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ title = "Gallery"
#website = "https://example.com"
#mastodon = "https://example.com"
#pixelfed = "https://example.com"
[params.gallery]
#boxSpacing = 10
#targetRowHeight = 288
#targetRowHeightTolerance = 0.25

[outputs]
home = ["HTML", "RSS"]
Expand Down
6 changes: 3 additions & 3 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
"arrowNextTitle" (i18n "arrowNextTitle")
"errorMsg" (i18n "errorMsg")
"downloadTitle" (i18n "downloadTitle")
"boxSpacing" 10
"targetRowHeight" 288
"targetRowHeightTolerance" 0.25
"boxSpacing" (default 10 .Site.Params.gallery.boxSpacing)
"targetRowHeight" (default 288 .Site.Params.gallery.targetRowHeight)
"targetRowHeightTolerance" (default 0.25 .Site.Params.gallery.targetRowHeightTolerance)
}}
{{ $js := resources.Get "js/main.js" | js.Build (dict "minify" true "params" $params) | resources.Fingerprint }}
<script src="{{ $js.RelPermalink }}" defer></script>
Expand Down

0 comments on commit 5725be6

Please sign in to comment.