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

opengraph.html « social « partials « layouts - github.com/ribice/kiss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: be7e3d935c4460a827779eb160ccfab3644fadf9 (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 "data/title" . }}'>
<meta property='og:description' content='{{ partial "data/description" . }}'>
<meta property='og:url' content='{{ .Permalink }}'>
<meta property='og:site_name' content='{{ .Site.Title }}'>
<meta property='og:type' content='
  {{- if .IsPage -}}
    article
  {{- else -}}
    website
  {{- end -}}
'>

{{- with .Params.image -}}
    <meta property='og:image' content='{{ . | absURL }}'>
{{- else -}}
{{- with .Site.Params.Social.email -}}
    <meta property='og:image' content='https://www.gravatar.com/avatar/
        {{- . | md5 -}}
        ?s=256'>
{{- end -}}

{{- with .Params.audios -}}
  {{- range first 6 . -}}
    <meta property='og:audio' content='{{ . | absURL }}'>
  {{- end -}}
{{- end -}}

{{- with .Params.videos -}}
  {{- range first 6 . -}}
    <meta property='og:video' content='{{ . | absURL }}'>
  {{- end -}}
{{- end -}}

{{- if .IsPage -}}
    {{- with .Site.Params.Social.facebook -}}
      <meta property='article:author' content='https://facebook.com/{{ . }}'>
    {{- end -}}
  {{- end -}}

  {{- with .Site.Params.opengraph.facebook.pageid -}}
    <meta property='article:publisher' content='{{ . }}'>
  {{- end -}}

  <meta property='article:section' content='{{- .Section | title -}}'>
  {{- range .Params.tags -}}
    <meta property='article:tag' content='{{ . }}'>
  {{- end -}}
{{- end -}}

{{- $dateFormat := "2006-01-02T15:04:05Z07:00" -}}
{{- if .IsPage -}}
  {{- if not .PublishDate.IsZero -}}
    <meta property='article:published_time' content='{{ .PublishDate.Format $dateFormat }}'>
  {{- else if not .Date.IsZero -}}
    <meta property='article:published_time' content='{{ .Date.Format $dateFormat }}'>
  {{- end -}}

  {{- if not .Lastmod.IsZero -}}
    <meta property='article:modified_time' content='{{ .Lastmod.Format $dateFormat }}'>
  {{- end -}}

  {{- if not .ExpiryDate.IsZero -}}
    <meta property='article:expiration_time' content='{{ .ExpiryDate.Format $dateFormat }}'>
  {{- end -}}
{{- else -}}
  {{- if not .Site.LastChange.IsZero -}}
    <meta property='og:updated_time' content='{{ .Site.LastChange.Format $dateFormat }}'>
  {{- end -}}
{{- end -}}

{{- with .Site.Params.opengraph.facebook -}}
  {{- with .appid -}}
    <meta property='fb:app_id' content='{{ . }}'>
  {{- end -}}
  {{- range .admins -}}
    <meta property='fb:admins' content='{{ . }}'>
  {{- end -}}
{{- end -}}

{{- partial "social/twitter" . -}}