You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shiro.apache.org by bm...@apache.org on 2021/10/15 12:27:49 UTC
[shiro-site] branch jbake updated: make sure featured image url is
absolute.
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 9175ec4 make sure featured image url is absolute.
9175ec4 is described below
commit 9175ec47522076e5e7e045f6a3d208d61fc2975d
Author: Benjamin Marwell <bm...@apache.org>
AuthorDate: Fri Oct 15 14:25:51 2021 +0200
make sure featured image url is absolute.
---
jbake/templates/header.ftl | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/jbake/templates/header.ftl b/jbake/templates/header.ftl
index 522f6ff..e402828 100644
--- a/jbake/templates/header.ftl
+++ b/jbake/templates/header.ftl
@@ -89,9 +89,13 @@
<#else></#if>
<#-- custom featured image if it exists or default featured image. -->
<#if (content.featuredimage)?? >
- <#if (content.featuredimage)?starts_with("http") || (content.featuredimage)?starts_with("/")>
+ <#if (content.featuredimage)?starts_with("http")>
<meta property="og:image" content="${content.featuredimage}"/>
<meta property="twitter:image" content="${content.featuredimage}"/>
+ <#elseif (content.featuredimage)?starts_with("/")>
+ <#-- absolute path is not sufficient -- featured images must be an absolute URL. -->
+ <meta property="og:image" content="${config.site_host}${content.featuredimage}"/>
+ <meta property="twitter:image" content="${config.site_host}${content.featuredimage}"/>
<#else>
<#-- relative URI starting with ./ or directly with the image name. -->
<#assign imageprefix="${config.site_host}/${(content.uri?substring(0, content.uri?last_index_of('/')))}/" />