| 1 |
{{- $images := partial "_funcs/get-page-images" . }} |
| 2 |
{{- with index $images 0 }} |
| 3 |
<meta name="twitter:card" content="summary_large_image"> |
| 4 |
<meta name="twitter:image" content="{{ .Permalink }}"> |
| 5 |
{{- else }} |
| 6 |
<meta name="twitter:card" content="summary"> |
| 7 |
{{- end }} |
| 8 |
|
| 9 |
{{- with or .Title site.Title site.Params.title | plainify }} |
| 10 |
<meta name="twitter:title" content="{{ . }}"> |
| 11 |
{{- end }} |
| 12 |
|
| 13 |
{{- with or .Description .Summary site.Params.description | plainify | htmlUnescape }} |
| 14 |
<meta name="twitter:description" content="{{ trim . "\n\r\t " }}"> |
| 15 |
{{- end }} |
| 16 |
|
| 17 |
{{- $twitterSite := "" }} |
| 18 |
{{- with site.Params.social }} |
| 19 |
{{- if reflect.IsMap . }} |
| 20 |
{{- with .twitter }} |
| 21 |
{{- $content := . }} |
| 22 |
{{- if not (strings.HasPrefix . "@") }} |
| 23 |
{{- $content = printf "@%v" . }} |
| 24 |
{{- end }} |
| 25 |
<meta name="twitter:site" content="{{ $content }}"> |
| 26 |
{{- end }} |
| 27 |
{{- end }} |
| 28 |
{{- end }} |