refine twitter cards

This commit is contained in:
Reorx 2022-05-05 11:36:20 +08:00
parent 97af798ba1
commit 998ce46fb6
1 changed files with 4 additions and 4 deletions

View File

@ -73,12 +73,12 @@
{{- /* https://developer.twitter.com/en/docs/twitter-for-websites/cards/guides/getting-started */}}
{{- if .Params.cover.image }}
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:card" property="twitter:card" content="summary_large_image" />
<meta name="twitter:image" content="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}" />
<meta name="twitter:title" content="{{ .Title }}" />
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}"/>
<meta name="twitter:site" content="@novoreorx"/>
<meta name="twitter:creator" content="@novoreorx"/>
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}" />
<meta name="twitter:site" content="@novoreorx" />
<meta name="twitter:creator" content="@novoreorx" />
{{- else -}}
{{- template "_internal/twitter_cards.html" . -}}
{{- end -}}