Skip to content

Commit 68d63e6

Browse files
bors[bot]James Munns
andauthored
Merge #83
83: Add support for twitter cards (root page and blogposts) r=andre-richter a=jamesmunns Adds a default implementation of the twitter card format to the general index page, as well as a specialization for blog posts that uses the title and summary of the blogpost. Closes #67 Co-authored-by: James Munns <[email protected]>
2 parents 9cb1971 + 9f54c83 commit 68d63e6

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

themes/hyde/templates/index.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77
<!-- Enable responsiveness on mobile devices-->
88
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
99

10+
<!-- Twitter Card Support -->
11+
{% block twitter_meta %}
12+
<meta name="twitter:card" content="summary" />
13+
<meta name="twitter:site" content="@rustembedded" />
14+
<meta name="twitter:title" content="Rust Embedded" />
15+
<meta name="twitter:description" content="The Rust Embedded Working Group" />
16+
<meta name="twitter:image" content="{{ get_url(path="ewg-logo-blue-white-on-transparent.svg", trailing_slash=false) }}" />
17+
{%endblock twitter_meta %}
18+
1019
<title>{% block title %}{{ config.title }}{% endblock title %}</title>
1120

1221
<!-- CSS -->

themes/hyde/templates/page.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
{% extends "index.html" %}
22

3+
<!-- Twitter Card Support - Blog Post Override -->
4+
{% block twitter_meta %}
5+
<meta name="twitter:card" content="summary" />
6+
<meta name="twitter:site" content="@rustembedded" />
7+
<meta name="twitter:title" content="{{ page.title }}" />
8+
<meta name="twitter:description" content="{{ page.summary | safe }}" />
9+
<meta name="twitter:image" content="{{ get_url(path="ewg-logo-blue-white-on-transparent.svg", trailing_slash=false) }}" />
10+
{%endblock twitter_meta %}
11+
312
{% block content %}
413
<div class="post">
514
<h1 class="post-title">{{ page.title }}</h1>

0 commit comments

Comments
 (0)