Remove redundant twitter tags since they falls back to opengraph

This commit is contained in:
2025-07-05 01:46:42 -05:00
parent b4bff1e36d
commit 7e016547ec

View File

@ -1,3 +1,7 @@
{{/* we do not need to duplicate what's already covered by OpenGraph tags
* see: https://demo.bbaovanc.com/test/remove-twitter-tags/blog/swapfile-guide/
* so, no twitter:image/title/description
*/}}
{{ $images := $.Resources.ByType "image" }}
{{ $featured := $images.GetMatch "*feature*" }}
{{ if not $featured }}
@ -17,13 +21,10 @@
{{ else }}
<meta name="twitter:card" content="summary">
{{ end }}
<meta name="twitter:image" content="{{ $featured.Permalink }}">
{{ else }}
<meta name="twitter:card" content="summary">
{{ end }}
<meta name="twitter:title" content="{{ .Title | plainify }}">
<meta name="twitter:description" content="{{ (partial "seo-description.html" .) | plainify }}">
{{ with .Site.Params.social.twitter }}
<meta name="twitter:site" content="@{{ . }}">
{{ end }}