Optimize rss-image

This commit is contained in:
Joshua Goins 2025-01-03 10:34:20 -05:00
parent aad72ed12c
commit ca389c0d8a
6 changed files with 9 additions and 4 deletions

BIN
assets/rss-image.avif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
assets/rss-image.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

View file

@ -29,9 +29,9 @@ params:
isso_url: "comments.redstrate.com"
geekring_site_id: 227
gitlab_username: "redstrate"
profile_picture: "/rss-image.png"
profile_picture: "/rss-image.jpg"
images:
- rss-image.png
- rss-image.jpg
author: 'redstrate'
fediverse_url: "@redstrate@mastodon.art"
image_host: "https://images.redstrate.com"

View file

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -2,7 +2,6 @@
<html lang="{{ .Site.LanguageCode }}" prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#">
<head>
{{- partial "head.html" . -}}
{{- block "head" . }}{{- end }}
</head>
<body>

View file

@ -1,4 +1,10 @@
{{ with resources.Get .Site.Params.profile_picture }}
<picture>
{{ $avif_path := replace . ".png" ".avif "}}
{{ with resources.Get (strings.TrimSpace $avif_path) }}
<source srcset="{{ .RelPermalink }}" type="image/avif">
{{ end }}
<img alt="Profile Picture" src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}">
</picture>
{{ end }}
<h1>{{ .Site.Title }}</h1>