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" isso_url: "comments.redstrate.com"
geekring_site_id: 227 geekring_site_id: 227
gitlab_username: "redstrate" gitlab_username: "redstrate"
profile_picture: "/rss-image.png" profile_picture: "/rss-image.jpg"
images: images:
- rss-image.png - rss-image.jpg
author: 'redstrate' author: 'redstrate'
fediverse_url: "@redstrate@mastodon.art" fediverse_url: "@redstrate@mastodon.art"
image_host: "https://images.redstrate.com" 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#"> <html lang="{{ .Site.LanguageCode }}" prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#">
<head> <head>
{{- partial "head.html" . -}} {{- partial "head.html" . -}}
{{- block "head" . }}{{- end }} {{- block "head" . }}{{- end }}
</head> </head>
<body> <body>

View file

@ -1,4 +1,10 @@
{{ with resources.Get .Site.Params.profile_picture }} {{ with resources.Get .Site.Params.profile_picture }}
<img alt="Profile Picture" src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}"> <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 }} {{ end }}
<h1>{{ .Site.Title }}</h1> <h1>{{ .Site.Title }}</h1>