mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2025-07-13 15:17:28 -05:00
Compare commits
2 Commits
b4bff1e36d
...
master
Author | SHA1 | Date | |
---|---|---|---|
1f82ad4f0b
|
|||
7e016547ec
|
@ -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,21 @@
|
||||
{{ 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 }}">
|
||||
|
||||
{{/* twitter:site is the site author; twitter:creator is page author
|
||||
* https://developer.x.com/en/docs/x-for-websites/cards/guides/getting-started
|
||||
* "Card and Content Attribution"
|
||||
*/}}
|
||||
{{ with .Site.Params.social.twitter }}
|
||||
<meta name="twitter:site" content="@{{ . }}">
|
||||
{{ end }}
|
||||
{{ with .GetTerms "authors" }}
|
||||
{{ range . }}
|
||||
{{ with .Params.twitter }}
|
||||
<meta name="twitter:creator" content="@{{ . }}">
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
Reference in New Issue
Block a user