Skip to content

Commit ba0543f

Browse files
classabbyampthe-maldridge
authored andcommitted
add opengraph meta tags for rich url embeds on social sites
1 parent 465940c commit ba0543f

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

_config.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,12 @@ collections:
1717
platforms:
1818
output: true
1919

20+
defaults:
21+
- scope:
22+
path: "" # empty string for all files
23+
type: posts # limit to posts
24+
values:
25+
is_post: true # automatically set is_post=true for all posts
26+
2027
download_mirror: https://alpha.de.repo.voidlinux.org/live/current
2128
download_build_date: 2021-09-30

_layouts/default.html

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
11
<!DOCTYPE html>
2-
<html lang="en">
2+
<html lang="en" prefix="og: https://ogp.me/ns# article: http://ogp.me/ns/article#">
33
<head>
44
<meta charset="utf-8">
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<title>{{ page.title }}</title>
8+
9+
<meta property="og:title" content="{{ page.title }}">
10+
{% if page.is_post %}
11+
<meta property="og:description" content="{{ page.excerpt | strip_html | normalize_whitespace }}">
12+
<meta property="og:type" content="article">
13+
<meta property="article:published_time" content="{{ page.date | date: "%Y-%m-%d" }}">
14+
{% else %}
15+
<meta property="og:description" content="{{ site.name }}">
16+
{% endif %}
17+
<meta property="og:site_name" content="Void Linux">
18+
<meta property="og:image:url" content="/assets/img/voidlogo.png">
19+
<meta property="og:image:alt" content="Void Linux Logo">
20+
<meta name="theme-color" content="#478061">
21+
822
<link rel="icon" type="image/png" href="/assets/img/favicon.png" />
923
<link rel="stylesheet" href="/assets/css/bootstrap.min.css">
1024
<link rel="stylesheet" href="/assets/css/screen.css">

0 commit comments

Comments
 (0)