]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Added support of Twitter Cards for public articles 2418/head
authorNicolas Lœuillet <nicolas@loeuillet.org>
Mon, 10 Oct 2016 12:29:11 +0000 (14:29 +0200)
committerNicolas Lœuillet <nicolas@loeuillet.org>
Mon, 10 Oct 2016 12:33:34 +0000 (14:33 +0200)
src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/share.html.twig

index a0a0d3c36c2447140af57cefc09118e957d6294a..b50226ef16e5166d536fcfe49d60cf8a14707ff3 100644 (file)
         <meta property="og:title" content="{{ entry.title | raw }}" />
         <meta property="og:type" content="article" />
         <meta property="og:url" content="{{ app.request.uri }}" />
+        {% set picturePath = app.request.schemeAndHttpHost ~ asset('bundles/wallabagcore/themes/_global/img/logo-other_themes.png') %}
         {% if entry.previewPicture is not null %}
-        <meta property="og:image" content="{{ entry.previewPicture }}" />
-        {% else %}
-        <meta property="og:image" content="{{ app.request.schemeAndHttpHost }}{{ asset('bundles/wallabagcore/themes/_global/img/logo-other_themes.png') }}" />
+            {% set picturePath = entry.previewPicture %}
         {% endif %}
+        <meta property="og:image" content="{{ picturePath }}" />
+        <meta name="twitter:card" content="summary" />
+        <meta name="twitter:image" content="{{ picturePath }}" />
+        <meta name="twitter:site" content="@wallabagapp" />
+        <meta name="twitter:title" content="{{ entry.title | raw }}" />
     </head>
     <body>
         <header>