Welcome to mirror list, hosted at ThFree Co, Russian Federation.

opengraph.html « partials « layouts - github.com/wangchucheng/hugo-eureka.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6065b989746f3a01ca34617e034ce664bc21829d (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<meta property="og:title" content="{{ partial "get_title" . }}" />
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" />
{{ $icon := partial "get_image.html" (dict "context" . "url" .Site.Params.icon) }}
{{ with $icon }}
<meta property="og:image" content="{{ . }}">
{{ end }}

<meta property="og:url" content="{{ .Permalink }}" />

{{ with .Params.audio }}
<meta property="og:audio" content="{{ . | absURL }}" />
{{ end }}
{{ with .Description }}
<meta property="og:description" content="{{ . }}" />
{{ else }}
{{if .IsPage}}
<meta property="og:description" content="{{ .Summary }}" />
{{ else }}
{{ with .Site.Params.Description }}
<meta property="og:description" content="{{ . }}" />
{{ end }}
{{ end }}
{{ end }}

{{ with .Site.LanguageCode }}
<meta property="og:locale" content="{{ . }}" />
{{ end }}
{{ if .IsTranslated }}
{{ range .Translations }}
<meta property="og:locale:alternate" content="{{ .Lang }}" />
{{ end }}
{{ end }}

{{ with .Site.Title }}
<meta property="og:site_name" content="{{ . }}" />
{{ end }}

{{ with .Params.videos }}
{{ range . }}
<meta property="og:video" content="{{ . | absURL }}" />
{{ end }}
{{ end }}

{{ if .IsPage }}
{{ if not .PublishDate.IsZero }}
<meta property="article:published_time" content="{{ .PublishDate.Format "2006-01-02T15:04:05-07:00" | safeHTML }}" />
{{ else if not .Date.IsZero }}
<meta property="article:published_time" content="{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}" />
{{ end }}
{{ if not .Lastmod.IsZero }}
<meta property="article:modified_time" content="{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}" />
{{ end }}
{{ else }}
{{ if not .Date.IsZero }}
<meta property="og:updated_time" content="{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}" />
{{ end }}
{{ end }}

<meta property="article:section" content="{{ .Section }}" />
{{ with .Params.tags }}
{{ range first 6 . }}
<meta property="article:tag" content="{{ . }}" />
{{ end }}
{{ end }}

{{ if .GetTerms "series" }}
{{ $page_link := .Permalink }}
{{ $series := .Site.Taxonomies.series}}
{{ range (.GetTerms "series") }}
{{ range .Pages }}
{{ if ne .Page.Permalink $page_link }}
<meta property="og:see_also" content="{{ .Page.Permalink }}" />
{{ end }}
{{ end }}
{{ end }}
{{ else if (.Site.RegularPages.Related .) }}
{{ range (.Site.RegularPages.Related . | first 6) }}
<meta property="og:see_also" content="{{ .Page.Permalink }}" />
{{ end }}
{{ end }}