nicokaiser / hugo-theme-gallery

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

Support resource metadata #46

Closed nicokaiser closed 9 months ago

nicokaiser commented 9 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 9 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 9 months ago

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

HuggeK commented 5 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 5 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.