Previous
Meta fields
At the bottom of your base > layout.twig
file, you will find the following block:
{# SCHEMA.ORG INFO #}
{% block schema %}{% endblock %}
If you want to add Schema.org/JSON-LD information for a given entry type, simply add the following block and modify the values according to the desired fields.
This block should be placed within the template of the entry (at the top, for example).
{% block schema %}
<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "Recipe",
"name": "{{ entry.title }}", {# twig directement dans le js #}
"author": {
"@type": "Person",
"name": "{{ entry.schemaAuthor }}" {# twig directement dans le js #}
},
"datePublished": "2018-03-10",
"description": "{{ entry.schemaDescription }}", {# twig directement dans le js #}
"prepTime": "PT20M"
}
</script>
{% endblock %}
This block provides structured data for a Recipe entry, which search engines use to understand the content of the page better and provide rich snippets in search results. Modify the JSON-LD according to the specific requirements of your content and its associated fields to improve the SEO of your entries.