From fdbc026e4a4b6d5916ba8c9feda71ac6dcb85b9f Mon Sep 17 00:00:00 2001 From: Emre al-Turki <> Date: Sun, 4 Dec 2022 04:27:40 +0400 Subject: [PATCH] card_type param option is added for Twitter cards Now in config file, a desired parameter, which are listed in Twitter documentation put in README, can be set for card content --- README.md | 4 ++++ layouts/partials/head.html | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a0252d6..61afc72 100644 --- a/README.md +++ b/README.md @@ -214,6 +214,10 @@ paginate = 5 # include @ creator = "" site = "" + # set Twitter card type for Twitter cards + # see https://developer.twitter.com/en/docs/twitter-for-websites/cards/guides/getting-started#started + # default value is "summary" + card_type = "summary" [languages] [languages.en] diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 486656c..a614cdd 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -37,7 +37,11 @@ {{ end }} - +{{ if (isset $.Site.Params.Twitter "content") }} + +{{ else }} + +{{ end }} {{ if (isset $.Site.Params "twitter") }} {{ if (isset $.Site.Params.Twitter "site") }}