Twitter card + OG markup fixes
Remove Twitter card title, description and image (twitter cards fall back to OG markup for these elements). Fix og:image url for non-home content Conditionally show twitter:site tag
This commit is contained in:
parent
1b00e7e317
commit
a6ae1efab1
@ -28,11 +28,10 @@
|
||||
|
||||
<!-- Twitter Card -->
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="{{ if .IsHome }}{{ $.Site.Title }}{{ else }}{{ .Title }} :: {{ $.Site.Title }} {{ end }}" />
|
||||
<meta name="twitter:description" content="{{ if .IsHome }}{{ $.Site.Params.Subtitle }}{{ else }}{{ .Summary | plainify }}{{ end }}" />
|
||||
<meta name="twitter:site" content="{{ .Permalink }}" />
|
||||
<meta name="twitter:creator" content="{{ if .IsHome }}{{ $.Site.Owner }}{{ else }}{{ .Params.Author }}{{ end }}" />
|
||||
<meta name="twitter:image" content="{{ if .IsHome }}{{ $.Site.Params.favicon | absURL }}{{else}}{{ .Params.Cover | absURL }}{{ end }}">
|
||||
{{ if (isset .Params "twitterSite") | or (eq .Params.twitterSite "") }}
|
||||
<meta name="twitter:site" content="{{ $.Site.siteTwitter }}" />
|
||||
{{ end }}
|
||||
<meta name="twitter:creator" content="{{ if .IsHome }}{{ $.Site.twitterOwner }}{{ else }}{{ .Params.Author }}{{ end }}" />
|
||||
|
||||
<!-- OG data -->
|
||||
<meta property="og:locale" content="{{ $.Site.Language.Lang }}" />
|
||||
@ -41,7 +40,7 @@
|
||||
<meta property="og:description" content="{{ if .IsHome }}{{ $.Site.Params.Subtitle }}{{ else }}{{ .Summary | plainify }}{{ end }}" />
|
||||
<meta property="og:url" content="{{ .Permalink }}" />
|
||||
<meta property="og:site_name" content="{{ .Title }}" />
|
||||
<meta property="og:image" content="{{ if .IsHome }}{{ $.Site.Params.favicon | absURL }}{{else}}{{ with .Params.Cover }}{{ . | absURL }}{{ end }}">
|
||||
<meta property="og:image" content="{{ if .IsHome }}{{ $.Site.Params.favicon | absURL }}{{else}}{{ .Params.Cover | absURL }}{{ end }}">
|
||||
<meta property="og:image:width" content="2048">
|
||||
<meta property="og:image:height" content="1024">
|
||||
{{ range .Params.categories }}
|
||||
|
Loading…
Reference in New Issue
Block a user