Skip to content

Commit

Permalink
Re-add support for cover images in OpenGraph
Browse files Browse the repository at this point in the history
  • Loading branch information
adityatelange committed Nov 9, 2024
1 parent 8c5833b commit d360267
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions layouts/partials/templates/opengraph.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,17 @@
<meta property="og:type" content="website">
{{- end }}

{{- with partial "_funcs/get-page-images" . }}
{{- range . | first 6 }}
<meta property="og:image" content="{{ .Permalink }}">
{{- if .Params.cover.image -}}
{{- if (ne .Params.cover.relative true) }}
<meta property="og:image" content="{{ .Params.cover.image | absURL }}">
{{- else}}
<meta property="og:image" content="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}">
{{- end}}
{{- else }}
{{- with partial "_funcs/get-page-images" . }}
{{- range . | first 6 }}
<meta property="og:image" content="{{ .Permalink }}">
{{- end }}
{{- end }}
{{- end }}

Expand Down

0 comments on commit d360267

Please sign in to comment.