mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 15:57:57 +00:00
29 lines
No EOL
970 B
HTML
29 lines
No EOL
970 B
HTML
{{- /* based on Hugo 0.125.5 twitter_cards.html */}}
|
|
{{- $images := partial "_funcs/get-page-images" . }}
|
|
{{- with index $images 0 }}
|
|
<meta name="twitter:card" content="summary_large_image">
|
|
<meta name="twitter:image" content="{{ .Permalink }}">
|
|
{{- else }}
|
|
<meta name="twitter:card" content="summary">
|
|
{{- end }}
|
|
|
|
{{- with partial "title.gotmpl" (dict "page" . "fullyQualified" true "reverse" true) | plainify }}
|
|
<meta name="twitter:title" content="{{ . }}">
|
|
{{- end }}
|
|
|
|
{{- with trim (or .Description .Summary | plainify | htmlUnescape) "\n\r\t " }}
|
|
<meta name="twitter:description" content="{{ . }}">
|
|
{{- end }}
|
|
|
|
{{- $twitterSite := "" }}
|
|
{{- with site.Params.social }}
|
|
{{- if reflect.IsMap . }}
|
|
{{- with .twitter }}
|
|
{{- $content := . }}
|
|
{{- if not (strings.HasPrefix . "@") }}
|
|
{{- $content = printf "@%v" . }}
|
|
{{- end }}
|
|
<meta name="twitter:site" content="{{ $content }}"/>
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }} |