[gimp-web] themes: add metadata image support for news article.



commit d6b4a4d1f0ef5522bbb66ba3542a35bbe9f1184f
Author: Jehan <jehan girinstud io>
Date:   Wed Oct 6 16:39:01 2021 +0200

    themes: add metadata image support for news article.
    
    Now when a news article will add the "Image:" metadata, it will be used
    as a metadata image (used for instance when a news is linked from
    another website as link illustration; currently the generic Wilber is
    always used… which is a good default, but it would be nice to illustrate
    specific news articles with a specific image).

 themes/newgimp/templates/article.html | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/themes/newgimp/templates/article.html b/themes/newgimp/templates/article.html
index d0f471cf..fe62f10d 100644
--- a/themes/newgimp/templates/article.html
+++ b/themes/newgimp/templates/article.html
@@ -25,11 +25,19 @@
 
     <meta itemprop='url' content='{{ SITEURL }}/{{ article.url }}' />
     <meta itemprop='name' content='{{ SITENAME }} - {{ article.title|striptags }}' />
+  {% if article.image %}
+    <meta itemprop='image' content='{{ article.image }}' />
+  {% else %}
     <meta itemprop='image' content='{{ SITEURL }}/images/frontpage/wilber-big.png' />
+  {% endif %}
 
     <meta property='og:url' content='{{ SITEURL }}/{{ article.url }}' />
     <meta property='og:title' content='{{ SITENAME }} - {{ article.title|striptags }}' />
+  {% if article.image %}
+    <meta property='og:image' content='{{ article.image }}' />
+  {% else %}
     <meta property='og:image' content='{{ SITEURL }}/images/frontpage/wilber-big.png' />
+  {% endif %}
 
     {% if article.authors %}
     {% for author in article.authors %}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]