1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-24 13:12:10 +00:00
seirdy.one/themes/etch-custom/layouts/partials/head.html
rohan kumar 59bc793152
Asset organization
- Use the recommended resolution for the open graph image
- Since the mask-icon is onl served as a cache-busted asset and never
  served as a plain link from the site root, move it to assets/
- Cache-bust the webmanifest and put it in assets/
2020-12-16 13:19:32 -08:00

58 lines
3.3 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 }}
{{- $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 -}}
<!--apple-touch-icon and mask-icon used to be appple-specific, but now
they're pseudo-standards relied upon by other vendors too. See
https://html.spec.whatwg.org/multipage/semantics.html#attr-link-sizes-->
{{ printf `<link rel="apple-touch-icon" href="%s">` $icon_192.RelPermalink | safeHTML }}
{{ $mask_icon := resources.Get "/mask_apple.svg" | resources.Fingerprint "md5" -}}
{{ printf `<link rel="mask-icon" href="%s" color="black">` $mask_icon.RelPermalink | safeHTML }}
{{ $webmanifest := resources.Get "/manifest.webmanifest" | resources.Fingerprint "md5" -}}
{{ printf `<link rel="manifest" href="%s">` $webmanifest.RelPermalink | safeHTML }}
<link rel="alternate" type="application/rss+xml" href="{{ .Site.BaseURL }}posts/index.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 -}}
{{ $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 -}}
<!-- opengraph stuff; used in the Fediverse, Signal link previews, some
RSS readers, and a certain large social media company -->
<meta property="og:title" content="{{ .Title }}">
<meta property="og:site_name" content="{{ $.Site.Title }}">
{{- if (eq "page" .Kind) }}
<meta property="og:type" content="article">
{{- else }}
<meta property="og:type" content="website">
{{- end }}
{{ $og_image := resources.Get "/open_graph.png" | resources.Fingerprint "md5" -}}
{{ printf `<meta property="og:image" content="%s">` $og_image.Permalink | safeHTML }}
<meta property="og:image:type" content="image/png">
<meta property="og:image:height" content="630">
<meta property="og:image:width" content="1200">
<meta property="og:url" content="https://seirdy.one{{ .RelPermalink }}">
</head>