Skip to content

Commit d360267

Browse files
committed
Re-add support for cover images in OpenGraph
4a4d0c0
1 parent 8c5833b commit d360267

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

layouts/partials/templates/opengraph.html

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,17 @@
3333
<meta property="og:type" content="website">
3434
{{- end }}
3535

36-
{{- with partial "_funcs/get-page-images" . }}
37-
{{- range . | first 6 }}
38-
<meta property="og:image" content="{{ .Permalink }}">
36+
{{- if .Params.cover.image -}}
37+
{{- if (ne .Params.cover.relative true) }}
38+
<meta property="og:image" content="{{ .Params.cover.image | absURL }}">
39+
{{- else}}
40+
<meta property="og:image" content="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}">
41+
{{- end}}
42+
{{- else }}
43+
{{- with partial "_funcs/get-page-images" . }}
44+
{{- range . | first 6 }}
45+
<meta property="og:image" content="{{ .Permalink }}">
46+
{{- end }}
3947
{{- end }}
4048
{{- end }}
4149

0 commit comments

Comments
 (0)