Debian Codegraph @

tpl/tplimpl/embedded/templates/_partials/opengraph.html

raw
1 <meta property="og:url" content="{{ .Permalink }}">
2
3 {{- with or site.Title site.Params.title | plainify }}
4 <meta property="og:site_name" content="{{ . }}">
5 {{- end }}
6
7 {{- with or .Title site.Title site.Params.title | plainify }}
8 <meta property="og:title" content="{{ . }}">
9 {{- end }}
10
11 {{- with or .Description .Summary site.Params.description | plainify | htmlUnescape }}
12 <meta property="og:description" content="{{ trim . "\n\r\t " }}">
13 {{- end }}
14
15 {{- with or .Params.locale site.Language.Locale }}
16 <meta property="og:locale" content="{{ replace . `-` `_` }}">
17 {{- end }}
18
19 {{- if .IsPage }}
20 <meta property="og:type" content="article">
21 {{- with .Section }}
22 <meta property="article:section" content="{{ . }}">
23 {{- end }}
24 {{- $ISO8601 := "2006-01-02T15:04:05-07:00" }}
25 {{- with .PublishDate }}
26 <meta property="article:published_time" {{ .Format $ISO8601 | printf "content=%q" | safeHTMLAttr }}>
27 {{- end }}
28 {{- with .Lastmod }}
29 <meta property="article:modified_time" {{ .Format $ISO8601 | printf "content=%q" | safeHTMLAttr }}>
30 {{- end }}
31 {{- range .GetTerms "tags" | first 6 }}
32 <meta property="article:tag" content="{{ .Page.Title | plainify }}">
33 {{- end }}
34 {{- else }}
35 <meta property="og:type" content="website">
36 {{- end }}
37
38 {{- with partial "_funcs/get-page-images" . }}
39 {{- range . | first 6 }}
40 <meta property="og:image" content="{{ .Permalink }}">
41 {{- end }}
42 {{- end }}
43
44 {{- with .Params.audio }}
45 {{- range . | first 6 }}
46 <meta property="og:audio" content="{{ . | absURL }}">
47 {{- end }}
48 {{- end }}
49
50 {{- with .Params.videos }}
51 {{- range . | first 6 }}
52 <meta property="og:video" content="{{ . | absURL }}">
53 {{- end }}
54 {{- end }}
55
56 {{- range .GetTerms "series" }}
57 {{- range .Pages | first 7 }}
58 {{- if ne $ . }}
59 <meta property="og:see_also" content="{{ .Permalink }}">
60 {{- end }}
61 {{- end }}
62 {{- end }}
63
64 {{- with site.Params.social }}
65 {{- if reflect.IsMap . }}
66 {{- with .facebook_app_id }}
67 <meta property="fb:app_id" content="{{ . }}">
68 {{- else }}
69 {{- with .facebook_admin }}
70 <meta property="fb:admins" content="{{ . }}">
71 {{- end }}
72 {{- end }}
73 {{- end }}
74 {{- end }}