From 97af798ba1ff24a6eccf4b48e3cdfd2e89236a91 Mon Sep 17 00:00:00 2001 From: Reorx Date: Thu, 5 May 2022 11:24:13 +0800 Subject: simpler twitter cards --- layouts/partials/head.html | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'layouts/partials/head.html') diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 3dfd3a4..3411f18 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -57,12 +57,6 @@ {{- /* Favicons */}} - - - - - - {{- /* RSS */}} {{ range .AlternativeOutputFormats -}} @@ -76,8 +70,21 @@ {{- if hugo.IsProduction | or (eq site.Params.env "production") }} {{- template "_internal/google_analytics.html" . }} {{- end -}} + +{{- /* https://developer.twitter.com/en/docs/twitter-for-websites/cards/guides/getting-started */}} +{{- if .Params.cover.image }} + + + + + + +{{- else -}} + {{- template "_internal/twitter_cards.html" . -}} +{{- end -}} + {{- template "partials/templates/opengraph.html" . }} -{{- template "partials/templates/twitter_cards.html" . }} + {{- template "partials/templates/schema_json.html" . }} {{- partial "extend_head.html" . }} -- cgit v1.2.3