diff options
| author | Reorx <novoreorx@gmail.com> | 2022-05-09 22:26:45 +0800 |
|---|---|---|
| committer | Reorx <novoreorx@gmail.com> | 2022-05-09 22:26:45 +0800 |
| commit | 524fef2551c3a44ae960798e18232960dce5055e (patch) | |
| tree | 6a98e76f2567776d6b3cd4363c7d58e03cded75f | |
| parent | 402e1d89241adb87ed3e41779a3dd244dfc4e621 (diff) | |
use small card for twitter when no cover in page
| -rw-r--r-- | layouts/partials/head.html | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html index cdae3e5..9b50504 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -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" /> |
