~seirdy/seirdy.one

322dbf93e7b2475fbad9d76d34dcae1a7e57a6ea — Rohan Kumar 19 days ago 55d9928
Inline favicon

The favicon is 175 bytes, smaller than the size of the HTTP headers to
fetch it. It can be inlined.

Now, pages that don't have any other images need just a single request.
M layouts/partials/head.html => layouts/partials/head.html +3 -2
@@ 4,8 4,9 @@
<meta name="author" content="{{ .Site.Author.name }}">
{{- $icon_192 := resources.Get "/apple-touch-icon.png" | resources.Fingerprint "md5" -}}
{{ printf `<link rel="icon" sizes="192x192" href="%s" type="image/png">` $icon_192.RelPermalink | safeHTML }}
{{ $favicon := resources.Get "/favicon.png" | resources.Fingerprint "md5" -}}
{{ printf `<link rel="icon" sizes="32x32" href="%s" type="image/png">` $favicon.RelPermalink | safeHTML -}}
{{ $favicon := resources.Get "/favicon.png" -}}
{{ $favicon_base64 := $favicon.Content | base64Encode }}
{{ printf `<link rel="icon" sizes="32x32" href="data:image/png;base64,%s" type="image/png">` $favicon_base64 | safeHTML -}}
<!-- apple-touch-icon used to be apple-specific, but now it's
		 a pseudo-standard relied upon by other vendors too:
		 https://html.spec.whatwg.org/multipage/semantics.html#attr-link-sizes -->

M layouts/shortcodes/indieweb-author.html => layouts/shortcodes/indieweb-author.html +4 -2
@@ 1,3 1,5 @@
<!-- re-using the indefinetly-cached favicon to avoid bloating page size -->
{{ $favicon := resources.Get "/favicon.png" | resources.Fingerprint "md5" -}}
<span itemprop="author" class="h-card p-author vcard"><a href="https://seirdy.one" rel="author home" class="u-url url"><img class="u-photo photo" src="{{ $favicon.RelPermalink }}" width="16" height="16" alt="Rohan Kumar" > <span class="p-name fn n"><span class="p-given-name given-name">Rohan</span> <span class="p-family-name family-name">Kumar</span></span></a></span>
{{ $favicon := resources.Get "/favicon.png" -}}
{{- $favicon_base64 := $favicon.Content | base64Encode -}}
<span itemprop="author" class="h-card p-author vcard"><a href="https://seirdy.one" rel="author home" class="u-url url"><img class="u-photo photo" src="data:image/png;base64,{{ $favicon_base64 }}" width="16" height="16" alt="Rohan Kumar"> <span class="p-name fn n"><span class="p-given-name given-name">Rohan</span> <span class="p-family-name family-name">Kumar</span></span></a></span>


M layouts/shortcodes/indieweb-icon.html => layouts/shortcodes/indieweb-icon.html +3 -3
@@ 1,3 1,3 @@
<!-- re-using the indefinetly-cached favicon to avoid bloating page size -->
{{ $favicon := resources.Get "/favicon.png" | resources.Fingerprint "md5" -}}
<img class="u-photo photo" src="{{ $favicon.RelPermalink }}" width="16" height="16" alt="Rohan Kumar">
{{ $favicon := resources.Get "/favicon.png" -}}
{{- $favicon_base64 := $favicon.Content | base64Encode -}}
<img class="u-photo photo" src="data:image/png;base64,{{ $favicon_base64 }}" width="16" height="16" alt="Rohan Kumar">