| 1 | <meta property="og:title" content="{{ .Title }}"> |
| 2 | <meta |
| 3 | property="og:description" |
| 4 | content="{{ with .Description }} |
| 5 | {{ . }} |
| 6 | {{ else }} |
| 7 | {{ if .IsPage }} |
| 8 | {{ .Summary }} |
| 9 | {{ else }} |
| 10 | {{ with .Site.Params.description }}{{ . }}{{ end }} |
| 11 | {{ end }} |
| 12 | {{ end }}"> |
| 13 | <meta |
| 14 | property="og:type" |
| 15 | content="{{ if .IsPage }} |
| 16 | article |
| 17 | {{ else }} |
| 18 | website |
| 19 | {{ end }}"> |
| 20 | <meta property="og:url" content="{{ .Permalink }}"> |
| 21 | |
| 22 | {{- with $.Params.images -}} |
| 23 | {{- range first 6 . }} |
| 24 | <meta property="og:image" content="{{ . | absURL }}"> |
| 25 | {{ end -}} |
| 26 | {{- else -}} |
| 27 | {{- $featured := partial "opengraph/get-featured-image.html" . }} |
| 28 | {{- with $featured -}} |
| 29 | <meta property="og:image" content="{{ $featured.Permalink }}"> |
| 30 | {{- else -}} |
| 31 | {{- with $.Site.Params.images }} |
| 32 | <meta property="og:image" content="{{ index . 0 | absURL }}"> |
| 33 | {{ end -}} |
| 34 | {{- end -}} |
| 35 | {{- end -}} |
| 36 | |
| 37 | {{- if .IsPage }} |
| 38 | {{- $iso8601 := "2006-01-02T15:04:05-07:00" -}} |
| 39 | <meta property="article:section" content="{{ .Section }}"> |
| 40 | {{ with .PublishDate }} |
| 41 | <meta |
| 42 | property="article:published_time" |
| 43 | {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }}> |
| 44 | {{ end }} |
| 45 | {{ with .Lastmod }} |
| 46 | <meta |
| 47 | property="article:modified_time" |
| 48 | {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }}> |
| 49 | {{ end }} |
| 50 | {{- end -}} |
| 51 | |
| 52 | {{- with .Params.audio }}<meta property="og:audio" content="{{ . }}">{{ end }} |
| 53 | {{- with .Params.locale }} |
| 54 | <meta property="og:locale" content="{{ . }}"> |
| 55 | {{ end }} |
| 56 | {{- with .Site.Params.title }} |
| 57 | <meta property="og:site_name" content="{{ . }}"> |
| 58 | {{ end }} |
| 59 | {{- with .Params.videos }} |
| 60 | {{- range . }} |
| 61 | <meta property="og:video" content="{{ . | absURL }}"> |
| 62 | {{ end }} |
| 63 | |
| 64 | {{ end }} |
| 65 | |
| 66 | {{- /* If it is part of a series, link to related articles */}} |
| 67 | {{- $permalink := .Permalink }} |
| 68 | {{- $siteSeries := .Site.Taxonomies.series }} |
| 69 | {{ with .Params.series }} |
| 70 | {{- range $name := . }} |
| 71 | {{- $series := index $siteSeries ($name | urlize) }} |
| 72 | {{- range $page := first 6 $series.Pages }} |
| 73 | {{- if ne $page.Permalink $permalink }} |
| 74 | <meta property="og:see_also" content="{{ $page.Permalink }}"> |
| 75 | {{ end }} |
| 76 | {{- end }} |
| 77 | {{ end }} |
| 78 | |
| 79 | {{ end }} |
| 80 | |
| 81 | {{- /* Facebook Page Admin ID for Domain Insights */}} |
| 82 | {{- with site.Params.social.facebook_admin }} |
| 83 | <meta property="fb:admins" content="{{ . }}"> |
| 84 | {{ end }} |