summaryrefslogtreecommitdiff
path: root/layouts/partials/head.html
diff options
context:
space:
mode:
authorNantha Sorubakanthan <nantha@mielota.com>2025-09-21 17:32:32 +0200
committerNantha Sorubakanthan <nantha@mielota.com>2025-09-21 17:32:32 +0200
commitdf3d7d5734855f72b72bdb18bbf9e3599dec0156 (patch)
treeeb7111173c5bb3660505ea565e0f7e79d9c04274 /layouts/partials/head.html
first commit
Diffstat (limited to 'layouts/partials/head.html')
-rw-r--r--layouts/partials/head.html23
1 files changed, 23 insertions, 0 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
new file mode 100644
index 0000000..477643d
--- /dev/null
+++ b/layouts/partials/head.html
@@ -0,0 +1,23 @@
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width">
+{{ with .Params.css }}
+<link rel="stylesheet" href="{{ . }}">
+{{- else -}}
+<link rel="stylesheet" href="/style.css">
+{{- with .Section }}
+<link rel="stylesheet" href="/{{ . }}/{{ . }}.css">
+{{- end }}
+{{- end }}
+<title>{{ if .IsHome }}{{ site.Title }}{{ else }}{{ .Title }}{{ end }}</title>
+<meta name="author" content="{{ .Site.Params.email }} ({{ .Site.Params.name }})">
+<meta name="description" content="{{- plainify (chomp .Summary) -}}">
+<!-- OpenGraph specification -->
+<meta property="og:title" content="{{ if .IsHome }}{{ site.Title }}{{ else }}{{ .Title }}{{ end }}" />
+<meta property="og:description" content="{{- plainify (chomp .Summary) -}}" />
+<meta property="og:url" content="{{ .Permalink}}" />
+{{- $images := .Page.Resources.ByType "image" }}
+{{- with index $images 0 }}
+{{- $processed := .Resize "600x" }}
+{{- $processed := $processed.Crop "512x512" }}
+<meta property="og:image" content="{{ $processed.RelPermalink }}" />
+{{- end -}}