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

Patrick Kollitsch
2 days ago 7abd905913a476061ff6880f645c2ce2e1092278
refs
author Patrick Kollitsch <83281+davidsneighbour@users.noreply.github.com>
Saturday, June 6, 2026 08:56 +0200
committer GitHub <noreply@github.com>
Saturday, June 6, 2026 08:56 +0200
commit7abd905913a476061ff6880f645c2ce2e1092278
tree 3d13d7f9280ac697f404af8f5ba40b3ecc034ae3 tree | zip | gz
parent 9c1f363cad5333b070ed41c0182fabb84a11d14f view | diff
fix: generate responsive hero background images (#970)

## Summary

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

## Changes

* 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

Documentation PR: gohugo-ananke/documentation#14

## Verification

* Checked issue #362 and its comments, including the earlier unmerged PR
#540 as prior art.
* 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.

## Notes

This implementation is intentionally narrower than the older closed PR
#540. It only handles the hero background image requested by the issue
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