github.com/choria-io/go-choria@v0.28.1-0.20240416190746-b3bf9c7d5a45/docs/themes/hugo-theme-relearn/layouts/partials/twitter_cards.html (about) 1 {{- /* based on Hugo 0.125.0 _internal/twitter_cardss.html but with modified title */}} 2 {{- $images := partial "_funcs/get-page-images" . }} 3 {{- with index $images 0 }} 4 <meta name="twitter:card" content="summary_large_image"> 5 <meta name="twitter:image" content="{{ .Permalink }}"> 6 {{- else }} 7 <meta name="twitter:card" content="summary"> 8 {{- end }} 9 <meta name="twitter:title" content="{{ partial "pageHelper/title.hugo" (dict "page" . "fullyQualified" true "reverse" true) }}"> 10 <meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}"> 11 12 {{- $twitterSite := "" }} 13 {{- with site.Params.social.twitter }} 14 {{- $twitterSite = . }} 15 {{- else }} 16 {{- with site.Social.twitter }} 17 {{- $twitterSite = . }} 18 {{- $hugoVersion := "0.120.0" }} 19 {{- if ge hugo.Version $hugoVersion }} 20 {{- warnf "The social key in site configuration is deprecated. Use params.social.twitter instead." }} 21 {{- end }} 22 {{- end }} 23 {{- end }} 24 25 {{- with $twitterSite }} 26 {{- $content := . }} 27 {{- if not (strings.HasPrefix . "@") }} 28 {{- $content = printf "@%v" . }} 29 {{- end }} 30 <meta name="twitter:site" content="{{ $content }}"> 31 {{- end }}