mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-11-23 12:52:10 +00:00
Give indieweb icon a PNG fallback
This should improve compatibility with older and non-mainstream browsers.
This commit is contained in:
parent
48a9088ca1
commit
bd705cd0b1
3 changed files with 11 additions and 6 deletions
|
@ -338,7 +338,7 @@ pre {
|
|||
/* center standalone images; same justification as
|
||||
* for centering the body contents. Also makes images easier to see
|
||||
* for people holding a device with one hand. */
|
||||
picture > img {
|
||||
div[itemprop="articleBody"] img {
|
||||
display: block;
|
||||
height: auto;
|
||||
margin: auto;
|
||||
|
|
|
@ -1,9 +1,14 @@
|
|||
{{ $favicon := resources.Get "/favicon.png" -}}
|
||||
{{- $favicon_base64 := $favicon.Content | base64Encode -}}
|
||||
{{- $favicon_bigpng := resources.Get "/favicon192.png" | resources.Fingerprint "md5" -}}
|
||||
{{- $favicon_svg := resources.Get "/favicon.svg" | resources.Fingerprint "md5" -}}
|
||||
{{- if in site.BaseURL ".onion" -}}
|
||||
<img itemprop="image" class="u-photo photo" width="16" height="16" alt=""
|
||||
{{ if in site.BaseURL ".onion" -}}
|
||||
src="data:image/png;base64,{{ $favicon_base64 }}"
|
||||
src="data:image/png;base64,{{ $favicon_base64 }}" />
|
||||
{{- else -}}
|
||||
src="{{ $favicon_svg.RelPermalink }}"
|
||||
{{- end }} />
|
||||
<picture itemprop="image">
|
||||
<source srcset="{{ $favicon_svg.RelPermalink }}" type="image/svg+xml" />
|
||||
<img class="u-photo photo" width="16" height="16" alt=""
|
||||
src="{{ $favicon_bigpng.RelPermalink }}" />
|
||||
</picture>
|
||||
{{- end -}}
|
||||
|
|
|
@ -34,7 +34,7 @@ sed 7d "$html_file" | xmllint --format --encode UTF-8 --noent - | sd '^\t' '' >"
|
|||
| sd '<pre(?: tabindex="0")?>\n\t*<code ' '<pre tabindex="0"><code ' \
|
||||
| sd '(?:\n)?</code>\n(?:[\t\s]*)?</pre>' '</code></pre>' \
|
||||
| sd '</span>.span itemprop="familyName"' '</span> <span itemprop="familyName"' \
|
||||
| sd '(<img itemprop="image" class="u-photo photo"[^>]*/>)<span' '$1 <span' \
|
||||
| sd '</picture><span itemprop="name" class="p-name fn n">' '</picture> <span itemprop="name" class="p-name fn n">' \
|
||||
| sd '([a-z])<(data|time)' '$1 <$2'
|
||||
} >>"$xhtml_file"
|
||||
|
||||
|
|
Loading…
Reference in a new issue