Add warning if twitter username is missing

I don't know if the docs are correct, but they seem to say that
twitter:site is required for a card to render at all. Better safe than
sorry.

https://developer.x.com/en/docs/x-for-websites/cards/overview/markup
This commit is contained in:
2025-08-09 02:40:03 -05:00
parent c9909762d6
commit 62cdcf5b11

View File

@@ -31,6 +31,8 @@
*/}} */}}
{{ with .Site.Params.social.twitter }} {{ with .Site.Params.social.twitter }}
<meta name="twitter:site" content="@{{ . }}"> <meta name="twitter:site" content="@{{ . }}">
{{ else }}
{{ errorf "a twitter username is required for twitter cards to work" }}
{{ end }} {{ end }}
{{ with .GetTerms "authors" }} {{ with .GetTerms "authors" }}
{{ range . }} {{ range . }}