|
| 1 | +{{ $isPage := or (and (ne .Type "posts") (in "section page" .Kind )) (and (eq .Type "posts") (eq .Kind "page")) }} |
| 2 | + |
| 3 | +{{- if ne .Kind "home" }} |
| 4 | + <meta |
| 5 | + property="og:title" |
| 6 | + {{ partial "utils/title" . | printf "content=%q" | safeHTMLAttr }} |
| 7 | + /> |
| 8 | +{{- end }} |
| 9 | +{{- with .Site.Title }} |
| 10 | + <meta property="og:site_name" {{ . | printf "content=%q" | safeHTMLAttr }} /> |
| 11 | +{{- end }} |
| 12 | + <meta property="og:image" content="/images/TrueNAS_Open_Enterprise_Storage.png" /> |
| 13 | +{{- with partial "utils/description" . }} |
| 14 | + <meta property="og:description" content="{{ . | plainify | htmlUnescape | chomp }}" /> |
| 15 | +{{- end }} |
| 16 | +<meta property="og:type" content="{{ if $isPage }}article{{ else }}website{{ end }}" /> |
| 17 | +<meta property="og:url" content="{{ .Permalink }}" /> |
| 18 | +{{- with .Params.audio }} |
| 19 | + <meta property="og:audio" content="{{ . }}" /> |
| 20 | +{{- end }} |
| 21 | +{{- with .Params.locale }} |
| 22 | + <meta property="og:locale" content="{{ . }}" /> |
| 23 | +{{- end }} |
| 24 | +{{- with .Params.videos }} |
| 25 | + {{- range . }} |
| 26 | + <meta property="og:video" content="{{ . | absURL }}" /> |
| 27 | + {{- end }} |
| 28 | +{{- end }} |
| 29 | + |
| 30 | +{{- /* If it is part of a series, link to related articles */}} |
| 31 | +{{- if .Site.Taxonomies.series }} |
| 32 | + {{- $permalink := .Permalink -}} |
| 33 | + {{- $siteSeries := .Site.Taxonomies.series -}} |
| 34 | + {{- with .Params.series }} |
| 35 | + {{- range $name := . }} |
| 36 | + {{- $series := index $siteSeries ($name | urlize) }} |
| 37 | + {{- range $page := first 6 $series.Pages }} |
| 38 | + {{- if ne $page.Permalink $permalink }} |
| 39 | + <meta property="og:see_also" content="{{ $page.Permalink }}" /> |
| 40 | + {{- end }} |
| 41 | + {{- end }} |
| 42 | + {{- end }} |
| 43 | + {{- end }} |
| 44 | +{{- end }} |
| 45 | + |
| 46 | +{{ if $isPage -}} |
| 47 | + {{- $iso8601 := "2006-01-02T15:04:05-07:00" -}} |
| 48 | + <meta property="article:section" content="{{ .Section | humanize | title }}" /> |
| 49 | + {{- with .PublishDate }} |
| 50 | + <meta |
| 51 | + property="article:published_time" |
| 52 | + {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} |
| 53 | + /> |
| 54 | + {{- end }} |
| 55 | + {{- with .Lastmod }} |
| 56 | + <meta |
| 57 | + property="article:modified_time" |
| 58 | + {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} |
| 59 | + /> |
| 60 | + {{- end }} |
| 61 | +{{- end }} |
| 62 | + |
| 63 | +{{- /* Facebook Page Admin ID for Domain Insights */}} |
| 64 | +{{- with .Site.Social.facebook_admin }} |
| 65 | + <meta property="fb:admins" content="{{ . }}" /> |
| 66 | +{{- end }} |
0 commit comments