Skip to content

Commit 21c45c6

Browse files
authored
Merge pull request #367 from jwcooper/metadata
Metadata - Includes initial twitter cards and open graph and some clean up
2 parents a78fdd1 + 5ef6b39 commit 21c45c6

File tree

3 files changed

+48
-10
lines changed

3 files changed

+48
-10
lines changed

_config.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
title: CircuitPython
22
33
description: >-
4-
CircuitPython Organization
4+
The easiest way to program microcontrollers
5+
headline_image: "https://circuitpython.org/assets/images/CircuitPython_Hero.jpg"
56
timezone: America/New_York
6-
twitter_username: adafruit
7+
twitter_username: circuitpython
78
github_username: adafruit
9+
baseurl: ""
10+
url: "https://circuitpython.org"
811
paginate: 5
912
excerpt_separator: <!--more-->
1013
permalink: pretty

_includes/head.html

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
<head>
22
{% include analytics.html %}
3-
<meta charset="utf-8">
4-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
5-
<meta name="viewport" content="width=device-width, initial-scale=1">
6-
<link rel="icon" href="{{ "/assets/images/favicon.ico" | relative_url }}" type="image/x-icon" />
7-
<meta name="msapplication-TileColor" content="#1a1919">
8-
<meta name="msapplication-TileImage" content="https://cdn-shop.adafruit.com/static/mstile-144x144.png">
9-
<title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
10-
<meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">
3+
{% include metadata.html %}
114
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
125
<link rel="stylesheet" href="{{ "/assets/css/main.css" | relative_url }}">
136
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
7+
8+
<!-- CircuitPython RSS Feed -->
9+
<link rel="alternate"
10+
type="application/rss+xml"
11+
title="CircuitPython news!"
12+
href="https://blog.adafruit.com/category/circuitpython/feed/"/>
1413
<script src="{{ "/assets/javascript/header_mobile.js" | relative_url }}"></script>
1514
</head>
15+
16+

_includes/metadata.html

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<meta charset="utf-8" />
2+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
3+
<meta name="viewport" content="width=device-width, initial-scale=1">
4+
<link rel="icon" href="{{ "/assets/images/favicon.ico" | relative_url }}" type="image/x-icon" />
5+
<meta name="msapplication-TileColor" content="#1a1919">
6+
<meta name="msapplication-TileImage" content="https://cdn-shop.adafruit.com/static/mstile-144x144.png" />
7+
<title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
8+
<meta name="description" content="{% if page.excerpt %}{{ page.excerpt |
9+
strip_html | strip_newlines | truncate: 160 }}{% else
10+
%}{{ site.description }}{% endif %}" />
11+
12+
<!-- Twitter and Open Graph cards -->
13+
<meta name="twitter:site" content="@{{ site.twitter_username }}" />
14+
<meta property="og:url" content="{{ page.url | absolute_url }}" />
15+
{% if page.title %}
16+
<meta property="og:title" content="{{ site.title | append: ' - ' | append: page.title }}" />
17+
{% else %}
18+
<meta property="og:title" content="{{ site.title }}" />
19+
{% endif %}
20+
21+
{% if page.excerpt %}
22+
<meta property="og:description" content="{{ page.excerpt | strip_html | strip_newlines | truncate: 300 }}" />
23+
{% else %}
24+
<meta property="og:description" content="{{ site.description }}" />
25+
{% endif %}
26+
27+
{% if page.board_image %}
28+
<meta name="twitter:card" content="summary_large_image" />
29+
<meta property="og:image" content="{{ "/assets/images/boards/large/" | append: page.board_image | absolute_url }}" />
30+
{% else %}
31+
<meta name="twitter:card" content="summary" />
32+
<meta property="og:image" content="{{ site.headline_image }}" />
33+
{% endif %}
34+
<meta property="og:type" content="website" />

0 commit comments

Comments
 (0)