franca-theme-blog/templates/components/schema.j2

45 lines
1.2 KiB
Django/Jinja

{% if home %}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"name": "{{ title }}",
"url": "{{ config.base_url }}",
"description": "{{ description }}",
"thumbnailUrl": "{{ config.base_url + "/logo.svg" }}",
}
</script>
{% elif post %}
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": {{ config.schema.type }},
{% if section %}
"articleSection": {{ translate(section, language) }},
{% endif %}
{% if config.schema.type == 'TechArticle' %}
"proficiencyLevel": "Beginner",
{% endif %}
"name": {{ title }},
"headline": {{ title }},
"inLanguage": {{ language }},
"description": {{ description | striptags }},
"datePublished": {{ post.date }},
"author": {
"@type": "Person",
"name": {{ config.languages[language].author }},
"url": {{ config.base_url + "/" + language + "/about-author" }}
},
"publisher": {
"@type": "Organization",
"name": "{{ config.languages[language].title }}",
"url": {{ config.base_url }},
"logo": {
"@type": "ImageObject",
"url": {{ config.base_url + "/logo.svg" }}
}
}
}
</script>
{% endif %}