1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-09-19 20:02:10 +00:00

Fix onion site u-photo

Switch away from inline images; they cause more problems than they're
worth.
This commit is contained in:
Rohan Kumar 2024-03-18 18:09:15 -04:00
parent d3081ddc8a
commit 0b1a504b65
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479
2 changed files with 12 additions and 18 deletions

View file

@ -1,10 +1,7 @@
{{- $src := "" -}}
{{ $favicon := "/favicon.svg" -}}
{{- if in site.BaseURL ".onion" -}}
{{- $favicon := resources.Get "/favicon.png" -}}
{{- $favicon_base64 := $favicon.Content | base64Encode -}}
{{- $src = printf "data:image/png;base64,%s" $favicon_base64 -}}
{{- else -}}
{{- with (partialCached "cache-bust.html" "/favicon.svg" "/favicon.svg") -}}
{{- $src = .Permalink -}}
{{- end -}}{{- end -}}
<img itemprop="image" width="16" height="16" alt="" src="{{ $src }}" class="u-photo photo" />
{{- $favicon = "/favicon.png" -}}
{{- end -}}
{{- with (partialCached "cache-bust.html" "/favicon.png" "/favicon.png") -}}
<img itemprop="image" width="16" height="16" alt="" src="{{ .Permalink }}" class="u-photo photo" />
{{- end -}}

View file

@ -1,10 +1,7 @@
{{- $src := "" -}}
{{ $favicon := "/favicon.svg" -}}
{{- if in site.BaseURL ".onion" -}}
{{- $favicon := resources.Get "/favicon.png" -}}
{{- $favicon_base64 := $favicon.Content | base64Encode -}}
{{- $src = printf "data:image/png;base64,%s" $favicon_base64 -}}
{{- else -}}
{{- with (partialCached "cache-bust.html" "/favicon.svg" "/favicon.svg") -}}
{{- $src = .Permalink -}}
{{- end -}}{{- end -}}
<img itemprop="image" width="16" height="16" alt="" src="{{ $src }}" class="u-photo photo" />
{{- $favicon = "/favicon.png" -}}
{{- end -}}
{{- with (partialCached "cache-bust.html" "/favicon.png" "/favicon.png") -}}
<img itemprop="image" width="16" height="16" alt="" src="{{ .Permalink }}" class="u-photo photo" />
{{- end -}}