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

twitter_og_cards.html « partials « layouts - github.com/dldx/hpstr-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 61f7ae6d313004b6193d4497a7a94ed4be65b261 (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
<!-- Twitter Cards -->
<meta name="twitter:title" content="{{ .Title }}">
{{ with .Description }}<meta name="twitter:description" content="{{ . }}">{{ end }}
{{ with .Site.Params.owner.twitter }}<meta name="twitter:creator" content="{{ . }}">{{ end }}
{{ if isset ($.Scratch.Get "Params") "image" }}
    {{ $imageparams := index ($.Scratch.Get "Params") "image" }}
    {{ with $imageparams.thumb }}
        <meta name="twitter:card" content="summary">
        <meta name="twitter:image" content="{{ . | absURL }}">
    {{ else }}
        <meta name="twitter:card" content="summary_large_image">
        <meta name="twitter:image" content="{{ $imageparams.feature | absURL }}">
    {{ end }}
{{ end }}

<!-- Open Graph -->
<meta property="og:type" content="article">
<meta property="og:title" content="{{ .Title }}">
{{ with .Description }}<meta property="og:description" content="{{ . }}">{{ end }}
<meta property="og:url" content="{{ .Permalink }}">
<meta property="og:site_name" content="{{ .Site.Title }}">
{{ with .Site.Params.locale }}<meta property="og:locale" content="{{ . }}" />{{ end }}
{{ if isset ($.Scratch.Get "Params") "image" }}
    {{ $imageparams := index ($.Scratch.Get "Params") "image" }}
    <meta property="og:image" content="{{ $imageparams.feature | absURL }}" />
{{ end }}
{{ if not .Date.IsZero }}
  <meta property="og:updated_time" content="{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}"/>
{{ end }}