Skip to content

Commit 37e2300

Browse files
committed
Adds opengraph image
- Reorders meta tags
1 parent 8ea6a49 commit 37e2300

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

_includes/head.html

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,24 @@
66
<meta name="theme-color" content="#1e1830">
77
<meta name="keywords" content="node-based, compositor, compositing, computer graphics, cgi, open source, vfx, software">
88
<title>{{ page.title }}</title>
9-
<!-- OpenGraph Card -->
9+
<!-- OpenGraph & Twitter Card Tags -->
1010
<meta property="og:type" content="website">
1111
<meta property="og:title" content="{{page.title}}">
12-
<meta property="og:image" content="">
1312
<meta property="og:image:width" content="1920">
1413
<meta property="og:image:height" content="1080">
14+
{% if page.postimg %}
15+
<meta property="og:image" content="{{ site.url | append: "/" }}{{ page.postimg }}" />
16+
<meta name="twitter:image" content="{{ site.url | append: "/"}}{{ page.postimg }}" />
17+
{% else %}
18+
<meta property="og:image" content="{{ "/img/social-preview.jpg" | prepend: site.url }}" />
19+
<meta name="twitter:image" content="{{ "/img/social-preview.jpg" | prepend: site.url }}" />
20+
{% endif %}
1521
<meta name="og:description" content="{% if page.description %}
1622
{{ page.description | strip_html | strip_newlines | truncate: 160 }}
1723
{% else %}
1824
{{ site.description }}
1925
{% endif %}">
2026
<meta property="og:locale" content="en_US" />
21-
<!-- Twitter Card -->
2227
<meta name="twitter:card" content="summary_large_image">
2328
<meta name="twitter:domain" content="natrongithub.github.io">
2429
<meta name="twitter:title" content="{{page.title}}">
@@ -30,14 +35,6 @@
3035
<!-- RSS Feed -->
3136
<link rel="alternate" type="application/rss+xml" href="{% base %}feed.atom">
3237

33-
{% if page.postimg %}
34-
<meta property="og:image" content="{{ site.url | append: "/" }}{{ page.postimg }}" />
35-
<meta name="twitter:image" content="{{ site.url | append: "/"}}{{ page.postimg }}" />
36-
{% else %}
37-
<meta property="og:image" content="{{ "/img/social-preview.jpg" | prepend: site.url }}" />
38-
<meta name="twitter:image" content="{{ "/img/social-preview.jpg" | prepend: site.url }}" />
39-
{% endif %}
40-
4138
<!-- Stylesheets & Fonts -->
4239
<link rel="stylesheet" href="{% base %}css/main.css">
4340
<link rel="stylesheet" href="https://unpkg.com/boxicons@latest/css/boxicons.min.css">

img/social-preview.jpg

9.11 KB
Loading

0 commit comments

Comments
 (0)