website/_includes/schema.html
Lars Olesen 2f5e771072
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>
2024-05-05 17:35:22 +08:00

17 lines
674 B
HTML

<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>