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

schema.html « partials « layouts - github.com/lxndrblz/anatole.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4f82f2884fa90d3af9a58828a891f79ddc247f5e (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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
{{ if .IsHome -}}
  <script type="application/ld+json">
    {
      "@context": "http://schema.org",
      "@type": "WebSite",
      "name": {{ .Site.Title | jsonify | safeJS }},
      "url": "{{ .Site.BaseURL }}",
      "description": "{{ .Site.Params.description }}",
      "thumbnailUrl": "{{ .Site.Params.Logo | absURL }}",
      "license": "{{ .Site.Params.Copyright }}"
    }
  </script>

{{ else if .IsPage }}
  {{ $author :=  or (.Params.author) (.Site.Params.author) }}
  {{ $favicon := .Site.Params.favicon | absURL }}
  <script type="application/ld+json">
    {
        "@context": "http://schema.org",
        "@type": "BlogPosting",
        "articleSection": "{{ .Section }}",
        "name": "{{ .Title | safeJS }}",
        "headline": "{{ .Title | safeJS }}",
        "alternativeHeadline": "{{ .Params.lead }}",
        "description": "{{ if .Description }}
      {{ .Description | safeJS }}


    {{ else }}
      {{ if .IsPage }}
        {{ .Summary }}


      {{ end }}


    {{ end }}",
        "inLanguage": {{ .Site.LanguageCode | default "en-us" }},
        "isFamilyFriendly": "true",
        "mainEntityOfPage": {
            "@type": "WebPage",
            "@id": "{{ .Permalink }}"
        },
        "author" : {
            "@type": "Person",
            "name": "{{ $author }}"
        },
        "creator" : {
            "@type": "Person",
            "name": "{{ $author }}"
        },
        "accountablePerson" : {
            "@type": "Person",
            "name": "{{ $author }}"
        },
        "copyrightHolder" : {
            "@type": "Person",
            "name": "{{ $author }}"
        },
        "copyrightYear" : "{{ .Date.Format "2006" }}",
        "dateCreated": "{{ .Date.Format "2006-01-02T15:04:05.00Z" | safeHTML }}",
        "datePublished": "{{ .PublishDate.Format "2006-01-02T15:04:05.00Z" | safeHTML }}",
        "dateModified": "{{ .Lastmod.Format "2006-01-02T15:04:05.00Z" | safeHTML }}",
        "publisher":{
            "@type":"Organization",
            "name": {{ $author }},
            "url": {{ .Site.BaseURL }},
            "logo": {
                "@type": "ImageObject",
                "url": "{{ (printf "%s%s" $favicon "favicon-32x32.png") }}",
                "width":"32",
                "height":"32"
            }
        },
        "image": {{ if .Params.images }}
      [{{ range $i, $e := .Params.images }}
        {{ if $i }}
          ,

        {{ end }}
        {{ $e | absURL }}


      {{ end }}
      ]

    {{ else }}
      [{{ range $i, $e := .Site.Params.images }}
        {{ if $i }}
          ,

        {{ end }}
        {{ $e | absURL }}


      {{ end }}
      ]

    {{ end }},
        "url" : "{{ .Permalink }}",
        "wordCount" : "{{ .WordCount }}",
        "genre" : [ {{ range $index, $tag := .Params.categories }}
      {{ if $index }}
        ,

      {{ end }}
      "{{ $tag }}"

    {{ end }}],
        "keywords" : [ {{ range $index, $keyword := .Params.tags }}
      {{ if $index }}
        ,

      {{ end }}
      "{{ $keyword }}"

    {{ end }}]
    }
  </script>

{{ end }}