mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2024-12-22 12:13:19 -06:00
18 lines
687 B
HTML
18 lines
687 B
HTML
{{ $images := $.Resources.ByType "image" }}
|
|
{{ $featured := $images.GetMatch "*feature*" }}
|
|
{{ if not $featured }}
|
|
{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}
|
|
{{ end }}
|
|
|
|
{{ with $featured }}
|
|
<meta name="twitter:card" content="summary">
|
|
<meta name="twitter:image" content="{{ $featured.Permalink }}">
|
|
{{ end }}
|
|
|
|
<meta name="twitter:title" content="{{ .Title }}">
|
|
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{ if .IsPage }}{{ .Summary | plainify }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">
|
|
|
|
{{ with .Site.Social.twitter }}
|
|
<meta name="twitter:site" content="@{{ . }}">
|
|
{{ end }}
|