Split schema to a separate include file (#3085)
* Make changes to schema easier * Only show on one page not on all pages * Move schema.html to _includes/ and move the URL guard out --------- Co-authored-by: iBug <git@ibugone.com>
This commit is contained in:
parent
16103c6d49
commit
2f5e771072
16
_includes/schema.html
Normal file
16
_includes/schema.html
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<script type="application/ld+json">
|
||||||
|
{
|
||||||
|
"@context": "https://schema.org",
|
||||||
|
{% if site.social.type == "Organization" %}
|
||||||
|
"@type": "Organization",
|
||||||
|
"url": {{ '/' | absolute_url | jsonify }}{% if site.og_image %},
|
||||||
|
"logo": {{ site_og_image | jsonify }}{% endif %}{% if site.social.links %},
|
||||||
|
"sameAs": {{ site.social.links | jsonify }}{% endif %}
|
||||||
|
{% else %}
|
||||||
|
"@type": "Person",
|
||||||
|
"name": {{ site.social.name | default: site.name | jsonify }},
|
||||||
|
"url": {{ '/' | absolute_url | jsonify }}{% if site.social.links %},
|
||||||
|
"sameAs": {{ site.social.links | jsonify }}{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
}
|
||||||
|
</script>
|
@ -121,21 +121,9 @@
|
|||||||
<link rel="next" href="{{ paginator.next_page_path | absolute_url }}">
|
<link rel="next" href="{{ paginator.next_page_path | absolute_url }}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<script type="application/ld+json">
|
{% if page.url == '/' %}
|
||||||
{
|
{% include schema.html %}
|
||||||
"@context": "https://schema.org",
|
|
||||||
{% if site.social.type == "Organization" %}
|
|
||||||
"@type": "Organization",
|
|
||||||
"url": {{ '/' | absolute_url | jsonify }}{% if site.og_image %},
|
|
||||||
"logo": {{ site_og_image | jsonify }}{% endif %}
|
|
||||||
{% else %}
|
|
||||||
"@type": "Person",
|
|
||||||
"name": {{ site.social.name | default: site.name | jsonify }},
|
|
||||||
"url": {{ '/' | absolute_url |jsonify }}{% if site.social.links %},
|
|
||||||
"sameAs": {{ site.social.links | jsonify }}{% endif %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
{% if site.google_site_verification %}
|
{% if site.google_site_verification %}
|
||||||
<meta name="google-site-verification" content="{{ site.google_site_verification }}" />
|
<meta name="google-site-verification" content="{{ site.google_site_verification }}" />
|
||||||
|
Loading…
Reference in New Issue
Block a user