Skip to content

Commit

Permalink
Implement structured data
Browse files Browse the repository at this point in the history
Closes #64
  • Loading branch information
jonaharagon committed Sep 15, 2021
1 parent a04a293 commit 5441f4a
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
14 changes: 14 additions & 0 deletions _data/schema/organization.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"@context": https://schema.org
"@type": Organization
"name": Privacy Guides
"description": "Massive organizations are monitoring your online activities. Privacy Guides is your central privacy and security resource to protect yourself online."
"url": 'https://www.privacyguides.org'
"logo": 'https://www.privacyguides.org/assets/img/layout/apple-touch-icon.png'
"sameAs":
- 'https://www.wikidata.org/wiki/Q74788946'
- 'https://twitter.com/privacy_guides'
- 'https://github.com/privacyguides'
- 'https://github.com/privacytools'
- 'https://twitter.com/privacytoolsIO'
"alternateName":
- 'PrivacyTools'
4 changes: 4 additions & 0 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
<meta property="og:locale" content="en_US" />
<meta property="og:site_name" content="{{ site.title | escape }}" />

<script type="application/ld+json">
{{ site.data.schema.organization | jsonify }}
</script>

<link rel="apple-touch-icon" sizes="180x180" href="/assets/img/layout/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/assets/img/layout/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/assets/img/layout/favicon-16x16.png">
Expand Down
18 changes: 18 additions & 0 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@
layout: default
---

<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "Article",
"headline": "{{ page.title }}",
"description": "{{ page.excerpt }}",
"datePublished": "{{ page.date }}",
"publisher": {{ site.data.schema.organization | jsonify }},
"url": "{{ page.url | prepend: site.url }}",
"author": [
{% for author in page.author %}{"@type": "Person",
"name": "{{ author }}"
}{% unless forloop.last %}, {% endunless %}{% endfor %}
]
{% if page.cover %}, "image": "/assets/img/blog/{{ page.cover }}"{% endif %}
}
</script>

<div class="p-5 mb-3 text-light bg-700"{% if page.cover %} style="background-image: {{ page.color | default: "linear-gradient(to bottom, rgba(40, 50, 63, 0.3), rgba(40, 50, 63, 0.9))" }}, url(/assets/img/blog/{{ page.cover }}); background-size: cover; background-position: center;"{% endif %}>
<div class="container">
<div class="post-cover">
Expand Down

0 comments on commit 5441f4a

Please sign in to comment.