mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
64b4ad751e
- description - title - tags
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 "pageHelper/title.hugo" (dict "page" . "fullyQualified" true "reverse" true) | plainify }}
|
|
<meta name="twitter:title" content="{{ . }}">
|
|
{{- end }}
|
|
|
|
{{- with or .Description .Summary | plainify | htmlUnescape | chomp }}
|
|
<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 }} |