I am using my custom Twitter Cards implementation in oppose to templates/twitter_cards.html however would like to discuss that and possibly help to improve it.
I notices that the last change to that was in March 2021 which resulted in removing .Site.Authors
and twitter:creator
.
The second (twitter:creator
) wonder why was removed exactly?
I got this website that has a Twitter Site account (twitter:site
) but the author of this site has its own Twitter account (twitter:creator
).
In config I got specified [params]
and twitter
for the site as well as I got in config (on multi-author this will probably be in markdown file) got [author]
and twitter
there.
This results in that
<meta name="twitter:site" content="{{ .Site.Params.twitter }}"/>
<meta name="twitter:creator" content="{{ .Site.Author.twitter }}"/>
There is also the parameter twitter:image:alt"
that is worth adding.
I am using a different approach here, and on my site, this looks like that:
{{ if .Params.featuredImage }}
<meta name="twitter:image" content="{{ .Params.featuredImage | absURL }}"/>
<meta name="twitter:image:alt" content="{{ .Title }}"/>
{{ else }}
<meta name="twitter:image" content="{{.Site.BaseURL}}{{ .Site.Params.og_image }}"/>
{{ end }}
Unless I am missing something, I don’t see twitter:url
?
<meta name="twitter:url" content="{{ .Permalink }}"/>
What do you think?
Regerence: