Skip to content

Commit bde1db6

Browse files
committed
Show open graph image for social media
1 parent c8e8580 commit bde1db6

2 files changed

Lines changed: 35 additions & 29 deletions

File tree

_includes/head.html

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,21 @@
55

66
<title>
77
{% if page.title == "Home" %}
8-
{{ site.description }}
8+
{{ site.description }}
99
{% else %}
10-
{{ page.title }} &middot; {{ site.description }}
10+
{{ page.title }} &middot; {{ site.description }}
1111
{% endif %}
1212
</title>
1313

14+
{% if include.bg_photo %}
15+
<meta property="og:image" content="{{ site.url }}{{ include.bg_photo }}">
16+
{% endif %}
17+
1418
<link rel="stylesheet" href="/assets/css/rug14.css">
1519
<link rel="stylesheet" href="/assets/css/syntax.css">
1620
<link rel="stylesheet" href="/assets/css/bootstrap-dropdown.min.css">
17-
<link href='http://fonts.googleapis.com/css?family=Noto+Sans:400,700&amp;subset=latin,latin-ext' rel='stylesheet' type='text/css'>
21+
<link href='http://fonts.googleapis.com/css?family=Noto+Sans:400,700&amp;subset=latin,latin-ext' rel='stylesheet'
22+
type='text/css'>
1823

1924
<link rel="apple-touch-icon-precomposed" href="/apple-touch-icon-precomposed.png">
2025
<link rel="shortcut icon" href="/favicon.ico">

_layouts/page.html

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,34 @@
11
{% assign author = site.authors[page.author] %}
22
<!DOCTYPE html>
33
<html lang="en-us">
4-
{% include head.html %}
5-
{% include ga.html %}
4+
{% include head.html bg_photo=page.bg_photo %}
5+
{% include ga.html %}
66

7-
<body class="page">
8-
{% include header.html %}
9-
<div class="big-what">
10-
<header class="wrap">
11-
<h1 class="page-title">{{ page.title }}</h1>
12-
{% if author %}
13-
<span class="author-and-date">
14-
<a href="{{ author.url }}" class="author" rel="author">{{ author.name }}</a>
15-
<span class="date">
16-
{% if page.date %}
17-
on {{ page.date | date_to_string }}
18-
{% endif %}
19-
</span>
20-
</span>
21-
{% endif %}
22-
</header>
23-
</div>
7+
<body class="page">
8+
{% include header.html %}
9+
<div class="big-what">
10+
<header class="wrap">
11+
<h1 class="page-title">{{ page.title }}</h1>
12+
{% if author %}
13+
<span class="author-and-date">
14+
<a href="{{ author.url }}" class="author" rel="author">{{ author.name }}</a>
15+
<span class="date">
16+
{% if page.date %}
17+
on {{ page.date | date_to_string }}
18+
{% endif %}
19+
</span>
20+
</span>
21+
{% endif %}
22+
</header>
23+
</div>
2424

25-
<div class="main">
26-
<div class="wrap">
27-
{{ content }}
28-
</div><!-- /.wrap -->
29-
</div><!-- /.main -->
25+
<div class="main">
26+
<div class="wrap">
27+
{{ content }}
28+
</div><!-- /.wrap -->
29+
</div><!-- /.main -->
30+
31+
{% include footer.html %}
32+
</body>
3033

31-
{% include footer.html %}
32-
</body>
3334
</html>

0 commit comments

Comments
 (0)