Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor OpenGraph and Twitter Meta Tag Generation #304

Merged
merged 1 commit into from
Oct 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 -->