mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
23 lines
No EOL
990 B
HTML
23 lines
No EOL
990 B
HTML
{{- /* based on Hugo 0.125.3 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 }}
|
|
<meta name="twitter:title" content="{{ partial "pageHelper/title.hugo" (dict "page" . "fullyQualified" true "reverse" true) }}">
|
|
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ 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 }} |