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

Fingerprint webmanifest with FNV32a instead of md5

This commit is contained in:
Rohan Kumar 2024-01-30 18:02:00 -05:00
parent bf8aadf8bb
commit b1c5584679
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479

View file

@ -19,8 +19,12 @@
<link href="{{ .Site.Params.CanonicalBaseURL }}{{ $canonicalRelPermalink }}" rel="canonical" />
<link href="{{ .Site.Params.WebmentionEndpoint }}" rel="webmention" />
<link href="{{ printf `https://webmention.io/webmention?forward=%s` .Site.Params.WebmentionEndpoint}}" rel="pingback" />
{{ $webmanifest := resources.Get "/manifest.webmanifest" | resources.ExecuteAsTemplate "manifest.webmanifest" . | resources.Minify | resources.Fingerprint "md5" -}}
{{- printf `<link href="%s" rel="manifest" />` $webmanifest.RelPermalink | safeHTML -}}
{{ $webmanifest := resources.Get "/manifest.webmanifest" | resources.ExecuteAsTemplate "manifest.webmanifest" . | resources.Minify -}}
{{- $cacheBuster := $webmanifest.Content | crypto.FNV32a -}}
{{- $webmanifestFingerprinted := printf "/manifest.%d.webmanifest" $cacheBuster -}}
{{- with resources.Copy $webmanifestFingerprinted $webmanifest -}}
{{- printf `<link href="%s" rel="manifest" />` .RelPermalink | safeHTML -}}
{{- end -}}
<!--Feeds for both notes and articles; articles come first unless we're in the notes section.-->
{{- if or (eq .Section "notes") (eq .Title "Notes") -}}
<link rel="alternate" type="application/atom+xml" href="{{ site.BaseURL }}notes/atom.xml" title="Notes" />