~seirdy/seirdy.one

ref: b9e4be50f5e2b543df8e834ff2bc7893e084fd09 seirdy.one/themes/etch-custom/layouts/partials/head.html -rw-r--r-- 4.0 KiB
b9e4be50Rohan Kumar Metadata: description + cache-bust manifest icons 9 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta name="description" content="{{ if .Params.description }}{{ .Params.description }}{{ else }}{{ .Site.Params.Description }}{{ end }}">
	<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 -}}
	<!-- apple-touch-icon and mask-icon used to be apple-specific, but
	     now they're pseudo-standards relied upon by other vendors too:
	     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 defines even more icons. This is getting ridiculous -->
	{{ $webmanifest := resources.Get "/manifest.webmanifest" | resources.ExecuteAsTemplate "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") -}}
	{{ $dark := .Site.Params.dark | default "auto" -}}
	{{ if not (eq $dark "off") -}}
	{{ $resources = $resources | append (resources.Get "css/dark.css" | resources.ExecuteAsTemplate "dark.css" .) -}}
	{{ end -}}
	<!-- Tell the browser we support dark mode. If the user doesn't
	     specify a preference, prefer light mode; users who override
	     browser default stylesheets will be able to use their preferred
			 palette that way. -->
	<meta name="color-scheme" content="light dark">
	{{ $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 }}
	<!-- only load syntax-highlighting CSS if this page needs it -->
	{{ 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 -}}
	<!-- open graph 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 }}
	<!-- ANOTHER meta image?! When will it 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 }}">
	<meta property="og:description" content="{{ if .Params.description }}{{ .Params.description }}{{ else }}{{ .Site.Params.Description }}{{ end }}">
</head>