mirror of https://github.com/theNewDynamic/gohugo-theme-ananke.git

Patrick Kollitsch
2 days ago 9570264992f1f4923255bd8522a99c5552595d65
refs
author Patrick Kollitsch <83281+davidsneighbour@users.noreply.github.com>
Saturday, June 6, 2026 08:56 +0200
committer Patrick Kollitsch <83281+davidsneighbour@users.noreply.github.com>
Sunday, June 7, 2026 05:36 +0200
commit9570264992f1f4923255bd8522a99c5552595d65
tree b7243569b155793c76188499189265cf4b0c9813 tree | zip | gz
parent ddfc42c738d12303b442a6fd12e7cabc6eef614d view | diff
fix: generate responsive hero background images (#970)

Fixes #362 by generating responsive hero background image CSS when the
featured image is available as a Hugo Page Resource.

* Adds `layouts/_partials/func/GetFeaturedImageResource.html` to resolve
the same featured-image candidates as a Hugo image resource.
* Updates `layouts/_partials/page-header.html` to generate resized hero
background images with media queries.
* Adds the optional `[params.ananke] responsive_image_widths` setting,
defaulting to `[480, 960, 1440, 1920]`.
* Keeps the existing behaviour for static paths, remote paths, SVG
files, and images Hugo cannot resize.

Documentation PR: gohugo-ananke/documentation#14

* Checked issue #362 and its comments, including the earlier unmerged PR
* Checked `CONTRIBUTING.md` and used the required `development` base
branch.
* Compared `issues/362` against `development`; the branch is cleanly
ahead by two commits and behind by zero commits.
* Unable to run a local Hugo build in this environment because direct
`git clone` failed with DNS resolution for `github.com`; verified
changes by repository API inspection and compare output instead.

This implementation is intentionally narrower than the older closed PR
and avoids changing summary images or the figure shortcode.
1 files modified
1 files added
72 ■■■■■ changed files
layouts/_partials/func/GetFeaturedImageResource.html 45 ●●●●● diff | view | raw | blame | history
layouts/_partials/page-header.html 27 ●●●●● diff | view | raw | blame | history