site

personal website, served at mordaunt.dev/site
Log | Files | Refs

commit cea5f195622f70d19b48d29d2629eab2bc656e24
parent a67d2d53d37a516f24066c024292ab6703cc4498
Author: Jack Mordaunt <jackmordaunt.dev@gmail.com>
Date:   Fri, 11 Jul 2025 11:39:23 -0300

hugo-coder/layouts/partials/home/social.html: hack in custom svg icons

This is a hack for sure. It allows us to configure two separate svg
icons, one for dark and one for light theme.

Diffstat:
Mthemes/hugo-coder/layouts/partials/home/social.html | 11++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/themes/hugo-coder/layouts/partials/home/social.html b/themes/hugo-coder/layouts/partials/home/social.html @@ -4,7 +4,13 @@ {{ if .icon }} <li> <a href="{{ .url | safeURL }}" aria-label="{{ .name }}" {{ if .rel }}rel="{{ .rel }}"{{ end }} {{ if .target }}target="{{ .target }}"{{ end }} {{ if .type }}type="{{ .type }}"{{ end }}> - <i class="{{ .icon }}" aria-hidden="true"></i> + {{ if and .srclight .srcdark -}} + <img src="{{ .srclight }}" class="custom-icon custom-icon-light"/> + <img src="{{ .srcdark }}" class="custom-icon custom-icon-dark"/> + {{- else -}} + <i class="{{ .icon }}" aria-hidden="true"> + {{- end }} + </i> </a> </li> {{ else }} @@ -14,4 +20,4 @@ {{ end }} {{ end }} </ul> -{{ end }} -\ No newline at end of file +{{ end }}