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

Patrick Kollitsch
2 hours ago 006e3c84e3b229c68ae56a2d3723312f30b31d47
refs
author Patrick Kollitsch <83281+davidsneighbour@users.noreply.github.com>
Saturday, June 6, 2026 01:08 +0200
committer GitHub <noreply@github.com>
Saturday, June 6, 2026 01:08 +0200
commit006e3c84e3b229c68ae56a2d3723312f30b31d47
tree 8573e4ef27e5a4e2482b2a30e889d040ebd6de0a tree | zip | gz
parent 57a659b469bff0945c2aa71efd6de3090cf0315d view | diff
fix: apply configured social colours on hover for follow and share (#861) (#979)

Closes #861.

## Problem

Social follow/share icons never changed to their configured `color` on
hover — they stayed the default grey.

The generated hover CSS in `layouts/_partials/site-style.html` filtered
the networks map with `collections.Where $config.networks "slug" "in"
$networks`. `where ... "in"` over a Hugo `Params` **map** yields no
results, so **zero** per-network rules were ever emitted. On top of
that, only `follow.networks` were considered (never `share.networks`),
and only `color` was set (not `fill`).

## Fix

- Build the rules by ranging the configured network slugs and
`collections.Index`-ing into the networks map — the same lookup the
`follow.html` / `share.html` partials already use — instead of `where`
over a map.
- Cover the **union of follow and share** networks, so share-only
networks get hover colours too.
- Set both `color` and `fill`, so the monochrome SVG icons (which
inherit `fill: currentColor`) reliably pick up the brand colour on
hover.

## Verification

Built a test site configuring `follow.networks = ['github']` and
`share.networks = ['bluesky', 'reddit']`:

```
a.github:hover{color:#6cc644!important;fill:#6cc644!important}
a.bluesky:hover{color:#1185fe!important;fill:#1185fe!important}
a.reddit:hover{color:#ff4500!important;fill:#ff4500!important}
```

- Rendered anchors carry the matching classes (`ananke-social-link
github …`, `ananke-social-link bluesky …`), so the selectors apply.
- Production (minified) and development (non-minified) builds both emit
well-formed rules.
- A config with no networks configured emits no stray rules.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 files modified
29 ■■■■ changed files
layouts/_partials/site-style.html 29 ●●●● diff | view | raw | blame | history