1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-23 12:52: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.CanonicalBaseURL }}{{ $canonicalRelPermalink }}" rel="canonical" />
<link href="{{ .Site.Params.WebmentionEndpoint }}" rel="webmention" /> <link href="{{ .Site.Params.WebmentionEndpoint }}" rel="webmention" />
<link href="{{ printf `https://webmention.io/webmention?forward=%s` .Site.Params.WebmentionEndpoint}}" rel="pingback" /> <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" -}} {{ $webmanifest := resources.Get "/manifest.webmanifest" | resources.ExecuteAsTemplate "manifest.webmanifest" . | resources.Minify -}}
{{- printf `<link href="%s" rel="manifest" />` $webmanifest.RelPermalink | safeHTML -}} {{- $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.--> <!--Feeds for both notes and articles; articles come first unless we're in the notes section.-->
{{- if or (eq .Section "notes") (eq .Title "Notes") -}} {{- if or (eq .Section "notes") (eq .Title "Notes") -}}
<link rel="alternate" type="application/atom+xml" href="{{ site.BaseURL }}notes/atom.xml" title="Notes" /> <link rel="alternate" type="application/atom+xml" href="{{ site.BaseURL }}notes/atom.xml" title="Notes" />