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

seo.html « partials « layouts - github.com/mattstratton/castanet.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 814278eaeaee2008017213a438f864025b87d28d (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
<meta property="og:title" content="{{ title .Title }}" />
<meta name="twitter:title" content="{{ .Title }}"/>
<meta itemprop="name" content="{{ .Title }}">
<meta property="article:published_time" content="{{ dateFormat "2006-01-02T15:04:05Z07:00" .Date }}" />
<meta property="article:modified_time" content="{{ dateFormat "2006-01-02T15:04:05Z07:00" .Lastmod }}" />
<meta property="og:updated_time" content="{{ dateFormat "2006-01-02T15:04:05Z07:00" .Lastmod }}" />
{{- with .Site.Title -}}<meta property="og:site_name" content="{{ . }}" />{{- end -}}
{{- with .Params.locale -}}<meta property="og:locale" content="{{ . }}" />{{- end -}}
{{- if .IsHome -}}
    {{ with .Site.Params.feed.itunes_summary -}}
        <meta property="og:description" content="{{ . }}" />
        <meta name="twitter:description" content="{{ . }}" />
        <meta itemprop="description" content="{{ . }}" />
    {{- else -}}
        <meta property="og:description" content="{{ $.Site.Title }}" />
        <meta name="twitter:description" content="{{ $.Site.Title }}" />
        <meta itemprop="description" content="{{ $.Site.Title }}" />
    {{- end -}}
{{- else -}}
    <meta property="og:description" content="{{ if .Description }}{{ .Description }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ end }}{{ end }}" />
    <meta name="twitter:description" content="{{ if .Description }}{{ .Description }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ end }}{{ end }}" />
    <meta itemprop="description" content="{{ if .Description }}{{ .Description }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ end }}{{ end }}">
{{- end -}}
<!--
The twitter link can be based in short ("arresteddevops") or
long form ("https://twitter.com/arresteddevops")

In long form we need to strip everything but the twitter handle
for the SEO tags
-->
{{ if (isset .Site.Params.social "twitter" )}}
  {{ if gt (len (urls.Parse .Site.Params.social.twitter).Scheme) 0 }}
    <meta name="twitter:site" content="@{{ trim ((urls.Parse .Site.Params.social.twitter).Path) "/" }}"/>
    <meta name="twitter:creator" content="@{{ trim ((urls.Parse .Site.Params.social.twitter).Path) "/" }}"/>
  {{ else }}
    <meta name="twitter:site" content="@{{ .Site.Params.social.twitter }}"/>
    <meta name="twitter:creator" content="@{{ .Site.Params.social.twitter }}"/>
  {{ end }}
{{ end }}
{{ with .Site.Params.social.twitter_domain }}<meta name="twitter:domain" content="{{ . }}"/>{{ end }}
{{ if eq .Type "episode" }}
<meta property="og:type" content="article" />
{{- else if .Params.type -}}
<meta property="og:type" content="{{ .Params.type }}" />
{{- else -}}
<meta property="og:type" content="website" />
{{ end }}
<meta property="og:url" content="{{ .Permalink | relURL }}" />
{{ with .Params.images }}{{ range first 1 . }}
    <meta name="twitter:card" content="summary_large_image" />
    {{ if (eq (slicestr . 0 4) "http") }}
        <meta property="og:image" content="{{ . }}"/>
        <meta name="twitter:image" content="{{ . }}" />
        <meta itemprop="image" content="{{ . }}" />
    {{ else }}
        <meta property="og:image" content="{{ $.Site.BaseURL}}/{{ . }}" />
        <meta name="twitter:image" content="{{ $.Site.BaseURL}}/{{ . }}"/>
        <meta itemprop="image" content="{{ $.Site.BaseURL}}/{{ . }}" />
    {{ end }}
{{ end }}{{ end }}
<!-- Facebook Page Admin ID for Domain Insights -->
{{ with .Site.Params.social.facebook_admin }}
  {{ range . }}
    <meta property="fb:admins" content="{{ . }}" />
  {{ end }}
{{ end }}