templates/front_v4/mca/blog/_balise_schema_org.html.twig line 1

Open in your IDE?
  1. {# Post author #}
  2. {% if post.blogAuthor %}
  3.     <meta name="author" content="{{ post.blogAuthor.fullName }}">
  4. {% endif %}
  5. {% if blogPost.filename %}
  6.     {% set post_image_url = vich_uploader_asset(blogPost, 'imageFile') | imagine_filter('blog_post_main') %}
  7. {% endif %}
  8. <meta property="og:type" content="article">
  9. <meta property="og:title" content="{{ post.title }}">
  10. <meta property="og:image" content="{{ post_image_url }}">
  11. <meta property="article:published_time" content="{{ post.createdAt|date('Y-m-d') }}">
  12. {% if post.metaCustom %}
  13.     {{ post.metaCustom|raw }}
  14. {% endif %}
  15. <script type="application/ld+json">
  16.     {
  17.         "@context": "https://schema.org",
  18.         "@type": "Article",
  19.         "@id": "Article-{{ post.id }}",
  20.         "mainEntityOfPage": {
  21.             "@type": "WebPage",
  22.             "@id": "{{ app.request.getSchemeAndHttpHost ~ app.request.baseUrl ~ app.request.pathInfo }}"
  23.         },
  24.         "headline": "{{ post.metaTitle }}",
  25.         "description": "{{ post.metaDescription }}",
  26.         "image": "{{ post_image_url }}",
  27.     {% if post.blogAuthor %}
  28.         "author": {
  29.             "@type": "Person",
  30.             "name": "{{ post.blogAuthor.fullName }}"
  31.         },
  32.     {% endif %}
  33.     "publisher": {
  34.         "@type": "Organization",
  35.         "name": "Mon centre auditif",
  36.         "logo": {
  37.             "@type": "ImageObject",
  38.             "url": "https://mon-centre-auditif.com/build/mca_logo_horizontal.png"
  39.         }
  40.     },
  41.     "datePublished": "{{ post.createdAt|date('Y-m-d') }}",
  42.     "dateModified": "{{ post.updatedAt|date('Y-m-d') }}"
  43.     {% if post.metaSchema %}
  44.       ,
  45.       {{ post.metaSchema[1:-1]|raw }}
  46.     {% endif %}
  47. }
  48. </script>