Skip to content

Commit

Permalink
Updating OG and Twitter Image with blog post_image (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
bastosmichael authored Oct 27, 2023
1 parent 8f8b72b commit 0c0bc12
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions _includes/opengraph.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,30 @@
<meta name="description" content="{{ page.description }}">

<!-- Facebook Meta Tags -->
<meta property="og:url" content="{{ site.url }}{{ page.url }}">
<meta property="og:url" content="{{ site.url | append: page.url }}">
<meta property="og:type" content="article">
<meta property="og:title" content="{{ page.title }}">
<meta property="og:description" content="{{ page.title }} by {{ page.author }}">
<meta property="og:image" content="{{ page.image | prepend: '/assets/images/' | prepend: site.url | default: 'https://zcoregroup.github.io/assets/images/logos/default_og_wh_2.png' }}">

<meta property="og:description" content="{{ page.description | default: page.title }} by {{ page.author }}">
{% if page.post_image and page.post_image != "" %}
<meta property="og:image" content="{{ page.post_image | prepend: site.url }}">
{% elsif page.image and page.image != "" %}
<meta property="og:image" content="{{ page.image | prepend: '/assets/images/' | prepend: site.url }}">
{% else %}
<meta property="og:image" content="https://zcoregroup.github.io/assets/images/logos/default_og_wh_2.png">
{% endif %}

<!-- Twitter Meta Tags -->
<meta name="twitter:card" content="summary_large_image">
<meta property="twitter:domain" content="{{ site.url | replace: 'https://', '' }}">
<meta property="twitter:url" content="{{ site.url }}{{ page.url }}">
<meta property="twitter:url" content="{{ site.url | append: page.url }}">
<meta name="twitter:title" content="{{ page.title }}">
<meta name="twitter:description" content="{{ page.title }} by {{ page.author }}">
<meta name="twitter:image" content="{{ page.image | prepend: '/assets/images/' | prepend: site.url | default: 'https://zcoregroup.github.io/assets/images/logos/default_og_wh_2.png' }}">

<meta name="twitter:description" content="{{ page.description | default: page.title }} by {{ page.author }}">
{% if page.post_image and page.post_image != "" %}
<meta name="twitter:image" content="{{ page.post_image | prepend: site.url }}">
{% elsif page.image and page.image != "" %}
<meta name="twitter:image" content="{{ page.image | prepend: '/assets/images/' | prepend: site.url }}">
{% else %}
<meta name="twitter:image" content="https://zcoregroup.github.io/assets/images/logos/default_og_wh_2.png">
{% endif %}

<!-- Meta Tags Generated via https://www.opengraph.xyz -->

0 comments on commit 0c0bc12

Please sign in to comment.