3
3
< meta name ="twitter:creator " content ="{{ .Site.Params.twitterCreator }} ">
4
4
< meta name ="twitter:title " content ="{{ .Title }} ">
5
5
< meta name ="twitter:description " content ="{{ .Description }} ">
6
- {{ with $.Params.images -}}
7
- < meta name ="twitter:image " content ="{{ $.Permalink }}{{ index . 0 }} ">
8
- {{ else -}}
9
- {{ $images := $.Resources.ByType "image" -}}
10
- {{ $featured := $images.GetMatch "*feature*" -}}
11
- {{ if not $featured -}}
12
- {{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" -}}
13
- {{ end -}}
14
- {{ with $featured -}}
15
- < meta name ="twitter:image " content ="{{ $featured.Permalink }} ">
6
+ {{ with .Params.image }}
7
+ < meta name ="twitter:image " content ="{{ $.Permalink }}{{ . }} ">
8
+ {{ else }}
9
+ {{ with $.Params.images -}}
10
+ < meta name ="twitter:image " content ="{{ $.Permalink }}{{ index . 0 }} ">
16
11
{{ else -}}
17
- {{ with $.Site.Params.images -}}
18
- < meta name ="twitter:image " content ="{{ index . 0 | absURL }} ">
12
+ {{ $images := $.Resources.ByType "image" -}}
13
+ {{ $featured := $images.GetMatch "*feature*" -}}
14
+ {{ if not $featured -}}
15
+ {{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" -}}
16
+ {{ end -}}
17
+ {{ with $featured -}}
18
+ < meta name ="twitter:image " content ="{{ $featured.Permalink }} ">
19
19
{{ else -}}
20
- < meta name ="twitter:card " content ="summary ">
20
+ {{ with $.Site.Params.images -}}
21
+ < meta name ="twitter:image " content ="{{ index . 0 | absURL }} ">
22
+ {{ else -}}
23
+ < meta name ="twitter:card " content ="summary ">
24
+ {{ end -}}
21
25
{{ end -}}
22
26
{{ end -}}
23
27
{{ end -}}
28
+
24
29
< meta name ="twitter:image:alt " content ="{{ .Title }} ">
0 commit comments