theNewDynamic / gohugo-theme-ananke

Ananke: A theme for Hugo Sites
https://gohugo-ananke-theme-demo.netlify.com/
MIT License
1.13k stars 1.14k forks source link

Featured image attributions #488

Open tlindsay42 opened 2 years ago

tlindsay42 commented 2 years ago

I built a feature for my site for adding attributions with optional links for my featured images that I've sourced from Pixabay, Unsplash, et cetera. The attributions are defined via new front matter parameters: featured_image_attr and featured_image_attrlink. The parameter names were chosen for consistency with the existing featured_image theme parameter, and the attr and attrlink parameters of the built-in figure shortcode. Attributions are displayed at the bottom right of the featured image in desktop mode, and at the bottom left in tablet & mobile mode (via the tr-l Tachyon class).

Example front matter

featured_image_attr: 'Pixabay'
featured_image_attrlink: 'https://pixabay.com/photos/texture-sample-background-abstract-3319946/'

Example desktop mode screenshot image

Example mobile mode screenshot image

If you're interested in incorporating the feature, I'll send a PR.

?