Skip to content

Commit

Permalink
Fix og:image URL when using Cloudinary
Browse files Browse the repository at this point in the history
  • Loading branch information
keenanpayne committed Oct 31, 2022
1 parent fc30c8d commit 2b37edd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion _includes/globals/meta.njk
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
{% endif %}

{% if meta.image or metadata.image %}
<meta property="og:image" content="{{ metadata.url | replace('.com/', '.com') ~ meta.image or metadata.image }}" />
{% if 'https://res.cloudinary.com/' in meta.image %}
<meta property="og:image" content="{{ meta.image }}" />
{% else %}
<meta property="og:image" content="{{ metadata.url | replace('.com/', '.com') ~ meta.image or metadata.image }}" />
{% endif %}

<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="{{ metadata.url | replace('.com/', '.com') ~ meta.image or metadata.image }}">
Expand Down

0 comments on commit 2b37edd

Please sign in to comment.