[gimp-web] themes: use full URL for og:image.



commit 004b3204410db657e73898ac3dc661a57cb072f7
Author: Jehan <jehan girinstud io>
Date:   Tue Oct 19 00:15:42 2021 +0200

    themes: use full URL for og:image.
    
    Apparently this is what is expected. Relative, or even absolute images
    relatively to the domain's root are wrong, even though they would work
    on some websites.

 themes/newgimp/templates/article.html | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/themes/newgimp/templates/article.html b/themes/newgimp/templates/article.html
index fe62f10d..39459828 100644
--- a/themes/newgimp/templates/article.html
+++ b/themes/newgimp/templates/article.html
@@ -34,7 +34,11 @@
     <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 }}' />
+    {% if article.image[0] == '/' %}
+    <meta property='og:image' content='{{ SITEMAP_SITEURL }}{{ article.image }}' />
+    {% else %}
+    <meta property='og:image' content='{{ SITEMAP_SITEURL }}/{{ article.url }}/{{ article.image }}' />
+    {% endif %}
   {% else %}
     <meta property='og:image' content='{{ SITEURL }}/images/frontpage/wilber-big.png' />
   {% endif %}


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