This is an automated email from the ASF dual-hosted git repository.

bmarwell pushed a commit to branch jbake
in repository https://gitbox.apache.org/repos/asf/shiro-site.git


The following commit(s) were added to refs/heads/jbake by this push:
     new b819f6b  always show twittercard (also for pages)
b819f6b is described below

commit b819f6b3db5c2ab1e6479544fd45cab33972b7f3
Author: Benjamin Marwell <[email protected]>
AuthorDate: Fri Oct 15 15:08:21 2021 +0200

    always show twittercard (also for pages)
    
     - allow setting large twittercards
---
 .../blog/2020/05/25/feathercast-with-brian-demers.adoc   |  1 +
 jbake/templates/header.ftl                               | 16 ++++++++++------
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/jbake/content/blog/2020/05/25/feathercast-with-brian-demers.adoc 
b/jbake/content/blog/2020/05/25/feathercast-with-brian-demers.adoc
index 853f8e5..2062089 100644
--- a/jbake/content/blog/2020/05/25/feathercast-with-brian-demers.adoc
+++ b/jbake/content/blog/2020/05/25/feathercast-with-brian-demers.adoc
@@ -6,6 +6,7 @@
 :jbake-featuredimage: 2020-05-25_feathercast.jpg
 :jbake-featuredimagewidth: 1200
 :jbake-featuredimageheight: 628
+:jbake-twittercard: large
 :idprefix:
 :icons: font
 
diff --git a/jbake/templates/header.ftl b/jbake/templates/header.ftl
index d46eef3..2e2709f 100644
--- a/jbake/templates/header.ftl
+++ b/jbake/templates/header.ftl
@@ -57,17 +57,21 @@
         <#if (content.date)??>
     <meta property="article:published_time" 
content="${content.date?date?string.iso}"/>
         </#if>
-    <meta name="twitter:card" content="summary_large_image" />
-    <meta name="twitter:site" content="@ApacheShiro" />
-          <#if (content.author!"") != "">
-            <#assign authors = data.get('authors.yaml').authors>
-            <#if (authors[content.author?trim].twitter)??>
+        <#if (content.author!"") != "">
+          <#assign authors = data.get('authors.yaml').authors>
+          <#if (authors[content.author?trim].twitter)??>
     <meta name="twitter:creator" content="${authors[content.author].twitter}" 
/>
-            </#if>
+          </#if>
         </#if>
       <#-- fall through -->
       <#case "page">
     <meta property="og:type" content="article"/>
+    <#if (content.twittercard!"")?trim == "large">
+      <meta name="twitter:card" content="summary_large_image" />
+    <#else>
+      <meta name="twitter:card" content="summary" />
+    </#if>
+    <meta name="twitter:site" content="@ApacheShiro" />
         <#if (content.date)??>
     <meta property="article:modification_time" 
content="${content.date?date?string.iso}"/>
         </#if>

Reply via email to