|
2 | 2 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
3 | 3 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
4 | 4 |
|
| 5 | +{{/* ── Title ── */}} |
5 | 6 | <title>{{ if .IsHome }}{{ .Site.Title }} — {{ .Site.Params.tagline }}{{ else }}{{ .Title }} | {{ .Site.Title }}{{ end }}</title> |
6 | | -<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ .Site.Params.description }}{{ end }}"> |
7 | 7 |
|
8 | | -{{/* Resolve og:image from front matter */}} |
| 8 | +{{/* ── Description ── */}} |
| 9 | +{{ $desc := .Site.Params.description }} |
| 10 | +{{ with .Description }}{{ $desc = . }}{{ end }} |
| 11 | +<meta name="description" content="{{ $desc }}"> |
| 12 | + |
| 13 | +{{/* ── Author ── */}} |
| 14 | +{{ with .Params.author }}<meta name="author" content="{{ . }}">{{ end }} |
| 15 | + |
| 16 | +{{/* ── Robots ── */}} |
| 17 | +<meta name="robots" content="index, follow"> |
| 18 | + |
| 19 | +{{/* ── OG image: front matter → default social cover ── */}} |
9 | 20 | {{ $ogImage := "" }} |
10 | 21 | {{ with .Params.image }} |
11 | 22 | {{ $ogImage = absURL . }} |
| 23 | +{{ else }} |
| 24 | + {{ $cover := resources.Get "images/social_cover.png" }} |
| 25 | + {{ if $cover }} |
| 26 | + {{ $ogImage = ($cover | fingerprint).Permalink }} |
| 27 | + {{ end }} |
12 | 28 | {{ end }} |
13 | 29 |
|
| 30 | +{{/* ── Open Graph ── */}} |
14 | 31 | <meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}"> |
| 32 | +<meta property="og:site_name" content="{{ .Site.Title }}"> |
15 | 33 | <meta property="og:title" content="{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }}{{ end }}"> |
16 | | -<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{ .Site.Params.description }}{{ end }}"> |
| 34 | +<meta property="og:description" content="{{ $desc }}"> |
17 | 35 | <meta property="og:url" content="{{ .Permalink }}"> |
18 | | -<meta property="og:site_name" content="{{ .Site.Title }}"> |
19 | | -{{ with $ogImage }}<meta property="og:image" content="{{ . }}">{{ end }} |
| 36 | +<meta property="og:locale" content="en_US"> |
| 37 | +{{ with $ogImage }} |
| 38 | +<meta property="og:image" content="{{ . }}"> |
| 39 | +<meta property="og:image:width" content="1200"> |
| 40 | +<meta property="og:image:height" content="630"> |
| 41 | +{{ end }} |
| 42 | + |
| 43 | +{{/* ── Article meta (blog posts only) ── */}} |
| 44 | +{{ if and .IsPage (eq .Section "blog") }} |
| 45 | +{{ with .Date }}<meta property="article:published_time" content="{{ .Format "2006-01-02T15:04:05Z07:00" }}">{{ end }} |
| 46 | +{{ with .Lastmod }}<meta property="article:modified_time" content="{{ .Format "2006-01-02T15:04:05Z07:00" }}">{{ end }} |
| 47 | +{{ with .Params.author }}<meta property="article:author" content="{{ . }}">{{ end }} |
| 48 | +{{ range .Params.tags }}<meta property="article:tag" content="{{ . }}">{{ end }} |
| 49 | +{{ end }} |
20 | 50 |
|
| 51 | +{{/* ── Twitter Card ── */}} |
21 | 52 | <meta name="twitter:card" content="{{ if $ogImage }}summary_large_image{{ else }}summary{{ end }}"> |
22 | 53 | <meta name="twitter:title" content="{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }}{{ end }}"> |
23 | | -<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{ .Site.Params.description }}{{ end }}"> |
| 54 | +<meta name="twitter:description" content="{{ $desc }}"> |
24 | 55 | {{ with $ogImage }}<meta name="twitter:image" content="{{ . }}">{{ end }} |
25 | 56 | {{ with .Site.Params.social.twitter }}<meta name="twitter:site" content="@{{ . }}">{{ end }} |
26 | 57 |
|
| 58 | +{{/* ── Canonical ── */}} |
27 | 59 | <link rel="canonical" href="{{ .Permalink }}"> |
28 | 60 |
|
| 61 | +{{/* ── Styles ── */}} |
29 | 62 | {{ $scss := resources.Get "scss/main.scss" | toCSS (dict "targetPath" "css/main.css" "enableSourceMap" false "outputStyle" "compressed") | fingerprint }} |
30 | 63 | <link rel="stylesheet" href="{{ $scss.RelPermalink }}"> |
31 | 64 |
|
| 65 | +{{/* ── Favicon ── */}} |
32 | 66 | <link rel="icon" type="image/svg+xml" href="/favicon.svg"> |
0 commit comments