1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-12-26 18:32:10 +00:00
seirdy.one/themes/etch-custom/layouts/partials/head.html
rohan kumar b9d22a1510
Update and cache-bust icons
- The old icon was too off-center; improve it.
- Add a mask icon
- Replace deprecated apple-touch-icon-precomposed.png with
  non-precomposed icon.
- Cache-bust all icons
2020-12-12 20:59:32 -08:00

40 lines
2.2 KiB
HTML

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{{ with .Site.Params.description -}}
<meta name="description" content="{{ . }}">
{{ end }}
{{- $favicon := resources.Get "/favicon.png" | resources.Fingerprint "sha384" -}}
{{ printf `<link rel="shortcut icon" href="%s" integrity="%s">` $favicon.RelPermalink $favicon.Data.Integrity | safeHTML }}
<link href="{{ .Site.BaseURL }}posts/index.xml" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }}"/>
{{ if eq .Site.BaseURL "https://envs.net/~seirdy/" -}}
<meta name="robots" content="noindex">
{{ else -}}
<link rel="canonical" href="https://seirdy.one{{ .RelPermalink }}"/>
{{ end -}}
<!--It used to be appple-specific, but now it's a pseudo-standard
relied upon by other vendors too.-->
{{- $apple_icon := resources.Get "/apple-touch-icon.png" | resources.Fingerprint "sha384" -}}
{{ printf `<link rel="apple-touch-icon" href="%s" integrity="%s">` $apple_icon.RelPermalink $apple_icon.Data.Integrity | safeHTML }}
{{- $mask_icon := resources.Get "/mask.svg" | resources.Fingerprint "sha384" -}}
{{ printf `<link rel="mask" href="%s" integrity="%s">` $mask_icon.RelPermalink $mask_icon.Data.Integrity | safeHTML }}
{{ $resources := slice -}}
{{ $resources = $resources | append (resources.Get "/css/main.css") -}}
{{ $resources = $resources | append (resources.Get "/css/narrow.css") -}}
{{ $dark := .Site.Params.dark | default "auto" -}}
{{ if not (eq $dark "off") -}}
{{ $resources = $resources | append (resources.Get "css/dark.css" | resources.ExecuteAsTemplate "dark.css" .) -}}
{{ end -}}
{{ $css := $resources | resources.Concat "css/style.css" | minify | resources.Fingerprint "sha384" -}}
{{ printf `<link rel="stylesheet" href="%s" integrity="%s">` $css.RelPermalink $css.Data.Integrity | safeHTML }}
{{ if .Params.highlight -}}
{{ $css_syntax := resources.Get "/css/syntax.css" | minify | resources.Fingerprint "sha384" }}
{{- printf `<link rel="stylesheet" href="%s" integrity="%s">` $css_syntax.RelPermalink $css_syntax.Data.Integrity | safeHTML }}
{{ end -}}
{{ if eq .RelPermalink "/" -}}
<title>{{ .Title }}</title>
{{ else -}}
<title>{{ .Title }} - Seirdy</title>
{{ end -}}
</head>