Skip to content

Instantly share code, notes, and snippets.

@inetbiz
Last active March 31, 2019 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inetbiz/8694c27ccc46d5a6984348c21914eb92 to your computer and use it in GitHub Desktop.
Save inetbiz/8694c27ccc46d5a6984348c21914eb92 to your computer and use it in GitHub Desktop.
Jekyll Article JSON+LD
---
layout: default
---
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Article",
"url": "{{ site.url }}{{ page.url }}",
"name": "{{ page.title | jsonify }}",
"headline": "{{ page.title | jsonify }}",
"keywords": "{{ page.tags | join: ',' | jsonify }}",
"description": "{{ page.excerpt | strip_newlines | strip | jsonify }}",
"articleBody": "{{ page.content | strip_html | jsonify }}",
"datePublished": "{{ page.date | jsonify }}",
"dateModified": "{{ page.last_modified_at | default: page.date | jsonify }}",
"author": {
"@type": "Person",
"@id": "{{site.author_id | jsonify }}",
"name": "{{ site.author_name | jsonify }}",
"givenName": "{{ site.author_first_name | jsonify }}",
"familyName": "{{ site.author_last_name | jsonify }}"
},
"publisher": {
"@type": "Person",
"@id": "https://gist.githubusercontent.com/inetbiz/a84101b9d979da51afcf22cebf0015f2/raw/dd0533afb35cac18c3c68371e1af7c42b133432a/schema-person.html",
"name": "{{ site.title | jsonify }}",
"url": "{{ site.url }}",
"logo": {
"@type": "ImageObject",
"width": 1000,
"height": 500,
"url": "{{ site.url }}/img/logo-denver.png"
}
},
"mainEntityOfPage": {
"@type": "ItemPage",
"@id": "{{ site.url }}{{ page.url }}"
},
"image": {
"@type": "ImageObject",
"width": "{{ page.img_width | default: site.img_width }}",
"height": "{{ page.img_height | default: site.img_height }}",
"url": "{{ site.url }}{{ page.img_url | default: site.img_url }}"
}
}
</script>
<header class="hero-image" style="background-image: url({{ site.baseurl }}/img/{{page.feature_image}}.jpg);">
<span class="menu-trigger animated fadeInDown">
<span class="bar"></span>
<span class="bar"></span>
<span class="bar"></span>
</span>
{% include nav.html %}
</header>
<main class="container">
<div class="row">
<article class="col-xs-12 single-content">
<header class="meta">
<h1>{{ page.title }}</h1>
<p><a href="{{ page.author_url | prepend: site.baseurl }}">{{ page.author_name | capitalize}}</a> in <a href='{{ "/category/" | append: page.categories.first | prepend: site.baseurl }}'>{{ page.categories[0] | capitalize }}</a> <i class="link-spacer"></i> <i class="fa fa-bookmark"></i> {{ page.read_time }} minutes</p>
</header>
{{ content }}
</article><!-- main-content/col -->
</div> <!--/row -->
</main> <!-- /container -->
<footer class="single">
{% include footer-single.html %}
{% if page.show_related_posts == true %}
{% include footer-related-posts.html %}
{% endif %}
</footer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment