bep / gallerydeluxe

Fast Hugo gallery theme/module suitable for lots of images.
MIT License
146 stars 31 forks source link

params not being passed through from galleriesdeluxe #29

Closed benstraw closed 3 months ago

benstraw commented 3 months ago

Hello,

I am working on a project using galleries deluxe theme. I have set in my params

[params]
    [params.galleriesdeluxe]
        shuffle     = true 

But it was not shuffling, I am using a modified header.html, so I output in that file [{{ site.Params.galleriesdeluxe }}], which correctly prints [true] to the page html output, but the gallery was still not shuffling. So I kept digging in, and was looking at partials/gallerydeluxe/head.html, and saw that is where the params get passed in, but see this in my source ...

(() => {
  // ns-params:@params
  var shuffle = false;

so I knew it was not getting there... so I copied head.html out of gallerydeluxe and pasted it into my own partials folder /partials/gallerydeluxe/head.html with the alert added, and it alerts false but still prints [map[sass_transpiler:dartsass sassvars:map[color_background:#1d1e2c] shuffle:true]] to my page. here is what I have for head.html:

<script>alert({{ site.Params.gallerydeluxe.shuffle }});</script>
{{ $js := resources.Get "js/gallerydeluxe/cdn/index.js" }}
{{ $js = $js | js.Build (dict "params" site.Params.gallerydeluxe "minify" hugo.IsProduction) }}
{{ $styles := resources.Get "css/gallerydeluxe/styles.css" }}
{{ if hugo.IsProduction}}
    {{ $js = $js | fingerprint }}
    {{ $styles = $styles | minify | fingerprint }}
{{ end }}
<script src="{{ $js.RelPermalink }}" defer></script>
<link rel="stylesheet" href="{{ $styles.RelPermalink }}"></link>

Is this a real bug, or am I doing something wrong? Thank you.

benstraw commented 3 months ago

yes. i did something wrong, i didn't notice the different params blocks gallerydeluxe and galleriesdeluxe...

doi!