Open rjwisloff opened 2 months ago
This should work:
In hugo.toml
add under [params]
a line
showDate = 'Yes'
and change the section mentioned above to
<span class="pswp-caption-content">
{{ with .Title }}{{ . }}<br /><hr />{{ end }}
{{ if eq $.Site.Params.showDate "Yes" }}
{{ with .Date }}{{ . | time.Format ":date_short" }}{{ end }}
{{ end }}
</span>
Setting showDate = 'No'
or whatever else than 'Yes'
disables showing the date.
Adding this in gallery.html after the end of the
<figure>
tag and before the<meta itemprop...>
tag will add the date of capture to the text next to the photo:I tried making this dependent on a parameter setting in
hugo.toml
, but for some reason e.g..Site.Params.showDate
is not picked up in this section. Perhaps there are scope limitations.