Consolidate JSON-LD blocks

This commit is contained in:
Pat Hawks 2016-02-22 10:35:55 -08:00
parent 507c498267
commit a9c7499319
1 changed files with 48 additions and 38 deletions

View File

@ -73,14 +73,6 @@
{% if seo_site_title %}
<meta property="og:site_name" content="{{ seo_site_title }}" />
<script type="application/ld+json">
{
"@context" : "http://schema.org",
"@type" : "WebSite",
"name" : {{ seo_site_title | jsonify }},
"url" : {{ seo_url | jsonify }}
}
</script>
{% endif %}
{% if page.image %}
@ -98,17 +90,6 @@
{% if page.previous.url %}
<link rel="prev" href="{{ page.previous.url | prepend: seo_url | replace:'/index.html','/' }}" title="{{ page.previous.title | escape }}" />
{% endif %}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "NewsArticle",
"headline": {{ page.title | jsonify }},
"image": {{ page.image | jsonify }},
"datePublished": {{ page.date | date_to_xmlschema | jsonify }},
"description": {{ seo_description | jsonify }}
}
</script>
{% endif %}
{% if site.twitter %}
@ -140,27 +121,56 @@
<meta name="google-site-verification" content="{{ site.google_site_verification }}" />
{% endif %}
{% if site.logo %}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Organization",
"url": {{ seo_url | jsonify }},
"logo": {{ site.logo | prepend: "/" | prepend: seo_url | jsonify }}
}
</script>
<script type="application/ld+json">
{
"@context" : "http://schema.org",
{% if page.seo and page.seo.type %}
"@type" : {{ page.seo.type | jsonify }},
{% elsif page.url == "/" %}
"@type" : "WebSite",
{% elsif page.date %}
"@type" : "BlogPosting",
{% else %}
"@type" : "WebPage",
{% endif %}
{% if site.social %}
<script type="application/ld+json">
{
"@context" : "http://schema.org",
"@type" : "{% if site.social.type %}{{ site.social.type }}{% else %}person{% endif %}",
"name" : "{% if site.social.name %}{{ site.social.name }}{% else %}{{ seo_site_title }}{% endif %}",
"url" : {{ seo_url | jsonify }},
"sameAs" : {{ site.social.links | jsonify }}
}
</script>
{% if page.seo and page.seo.name %}
"name" : {{ page.seo.name | jsonify }},
{% elsif page.url == "/" and site.social and site.social.name %}
"name" : {{ site.social.name | jsonify }},
{% elsif page.url == "/" and seo_site_title %}
"name" : {{ seo_site_title | jsonify }},
{% endif %}
{% if seo_page_title %}
"headline": {{ seo_page_title | jsonify }},
{% endif %}
{% if page.image %}
"image": {{ page.image | jsonify }},
{% endif %}
{% if page.date %}
"datePublished": {{ page.date | date_to_xmlschema | jsonify }},
{% endif %}
{% if page.description %}
"description": {{ page.description | jsonify }},
{% endif %}
{% if site.logo %}
"logo": {{ site.logo | prepend: "/" | prepend: seo_url | jsonify }},
{% endif %}
{% if page.seo and page.seo.links %}
"sameAs" : {{ page.seo.links | jsonify }},
{% elsif page.url == "/" and site.social and site.social.links %}
"sameAs" : {{ site.social.links | jsonify }},
{% endif %}
"url" : "{{ page.url | prepend: seo_url | replace:'/index.html','/' }}"
}
</script>
<!-- End Jekyll SEO tag -->