summaryrefslogtreecommitdiffstats
path: root/layouts/partials/templates/opengraph.html
blob: 55bcbe3756583ac45775daa9841ac9f748233411 (plain)
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
<!-- Open Graph metadata -->
    <meta property="og:title" content="{{ .Title }}">
    <meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">
    <meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}">
    <meta property="og:url" 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 }}

    {{- if .Params.cover.width -}}
    <meta property="og:image:width" content="{{ .Params.cover.width }}">
    {{- end }}

    {{- if .Params.cover.height -}}
    <meta property="og:image:height" content="{{ .Params.cover.height }}">
    {{- end }}
{{- else }}
    <meta property="og:image" content="{{ "img/open-graph-logo.png" | absURL }}">
    <meta property="og:image:width" content="200">
    <meta property="og:image:height" content="200">
{{- end }}

{{- /* Facebook Page Admin ID for Domain Insights */}}
{{- with site.Social.facebook_admin }}
    <meta property="fb:admins" content="{{ . }}">
{{- end }}
{{- with site.Social.facebook_id }}
    <meta property="fb:app_id" content="{{ . }}">
{{- end }}