nicokaiser / hugo-theme-gallery

Gallery Theme for Hugo
https://nicokaiser.github.io/hugo-theme-gallery/
MIT License
305 stars 85 forks source link

Support resource metadata #46

Closed nicokaiser closed 6 months ago

nicokaiser commented 6 months ago

Metadata can be set in front matter:

resources:
  - src: img_0001.jpg
    title: A nice view in the mountains
    params:
      cover: true

In addition to EXIF, support fetching metadata from there.

nicokaiser commented 6 months ago

Also the cover image could be retrieved from there:

{{ $cover := index (where $images "Params.cover" "eq" true) 0 | default (index $images 0) }}
nicokaiser commented 6 months ago

Currently (as of v3.1.0) only the Title can be set through resource metadata, which is fine for now.

HuggeK commented 2 months ago

Is there any option to include the metadata in the scaled down images which is shown on the page for indexing purposes of Google? Google search console would want the licensing information which can be included in the metadata of the file.

nicokaiser commented 2 months ago

I do not think this is currently possible with Hugo, since all metadata is removed when resizing images. That’s why at least some data is copied to the meta tags in gallery.html. I wonder if the original image can be referenced from there (or is it already?), so Google will pick up only the originals – but since those are not used at all on the websites (apart from the Download feature), I am not sure if this can be done.