use small card for twitter when no cover in page

This commit is contained in:
Reorx 2022-05-09 22:26:45 +08:00
parent 402e1d8924
commit 524fef2551
1 changed files with 2 additions and 1 deletions

View File

@ -78,12 +78,13 @@
{{- /* https://developer.twitter.com/en/docs/twitter-for-websites/cards/guides/getting-started */}}
{{- if .Params.cover.image }}
<meta name="twitter:image" content="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}" />
<meta name="twitter:card" property="twitter:card" content="summary_large_image" />
{{- else }}
{{- with site.Params.images -}}
<meta name="twitter:image" content="{{ index . 0 | absURL }}" />
<meta name="twitter:card" property="twitter:card" content="summary" />
{{- end }}
{{- end }}
<meta name="twitter:card" property="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="{{ $pageTitle }}" />
<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" />