diff --git a/base.html.twig b/base.html.twig index 6264ee9..7937232 100644 --- a/base.html.twig +++ b/base.html.twig @@ -2,15 +2,22 @@ - {% block meta %}{% endblock %} - - {% block title %}Welcome! - {% endblock %} + <meta name="viewport" content="width=device-width, initial-scale=1"/> + + {% block meta %} + {{ BetterSeoMicroData(null, null) | raw }} + {% endblock %} + + <title> + {% block title %}{{BetterSeoPageTitle()}}{% endblock %} + + {% block stylesheets %} {{ encore_entry_link_tags('app') }} {% endblock %} + {% block javascripts %} {{ encore_entry_script_tags('app') }} {% endblock %} diff --git a/category.html.twig b/category.html.twig index bf6f368..40fc6d2 100644 --- a/category.html.twig +++ b/category.html.twig @@ -11,12 +11,11 @@ {{ encore_entry_link_tags('category') }} {% endblock %} -{% block title %} - {{ 'Category'|trans }} -{% endblock %} {% block body %} - {% include '@components/Layout/Subheader/Category/SubheaderCategory.html.twig' with {title: attr('category', 'title'), description: attr('category', 'chapo'), nbProducts: 9, breadcrumb} %} + + + {% include '@components/Layout/Subheader/Category/SubheaderCategory.html.twig' with {title: BetterSeoPageH1("category", categoryId), description: attr('category', 'chapo'), nbProducts: 9, breadcrumb} %} {{ component('Flexy:Layout:CategoryProducts', {categoryId, page}) }} {% include '@components/Layout/Reinsurance/Reinsurance.html.twig' with { data: [ { diff --git a/composer.json b/composer.json index e19519f..772ba9e 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,9 @@ "symfony/ux-react": "^2.19", "symfony/ux-icons": "^2.19", "symfony/ux-translator": "^2.19", - "symfony/ux-live-component": "^2.19" + "symfony/ux-live-component": "^2.19", + "thelia/page-module": "dev-twig", + "thelia/better-seo-module": "dev-twig" }, "autoload": { "psr-4": { diff --git a/content.html.twig b/content.html.twig index f07dd05..d78365b 100644 --- a/content.html.twig +++ b/content.html.twig @@ -1,8 +1,6 @@ {% extends 'base.html.twig' %} +{% set contentId = attr('content', 'id') %} -{% block title %} - {{ 'Content page'|trans }} -{% endblock %} {% block body %} {% set contents = resources('/api/front/contents', {itemsPerPage:3}) %} @@ -14,7 +12,7 @@ img: {url: '/legacy-image-library/category_image_'~c.id~'/full/%5E*!386,280/0/default.webp', alt: c.i18ns.title} })) %} - {% include '@components/Layout/Subheader/ContentPage/SubheaderContentPage.html.twig' with {title: attr('content', 'title'), description: attr('content', 'chapo') } %} + {% include '@components/Layout/Subheader/ContentPage/SubheaderContentPage.html.twig' with {title: BetterSeoPageH1('content', contentId), description: attr('content', 'chapo') } %}
diff --git a/folder.html.twig b/folder.html.twig index b31c817..257c726 100644 --- a/folder.html.twig +++ b/folder.html.twig @@ -1,13 +1,9 @@ {% extends 'base.html.twig' %} -{% block title %} - {{ 'Folder page'|trans }} -{% endblock %} +{% set folderId = attr('folder', 'id') %} {% block body %} - - - {% include '@components/Layout/Subheader/ContentPage/SubheaderContentPage.html.twig' with {title: attr('folder', 'title'), description: attr('folder', 'chapo') } %} + {% include '@components/Layout/Subheader/ContentPage/SubheaderContentPage.html.twig' with {title: BetterSeoPageH1('folder', folderId), description: attr('folder', 'chapo') } %}
diff --git a/index.html.twig b/index.html.twig index 9621de7..32f9020 100644 --- a/index.html.twig +++ b/index.html.twig @@ -1,6 +1,6 @@ {% extends 'base.html.twig' %} -{% block title %}index{% endblock %} + {% block body %} diff --git a/product.html.twig b/product.html.twig index 88c0d28..2ea1007 100644 --- a/product.html.twig +++ b/product.html.twig @@ -10,11 +10,7 @@ {{ encore_entry_script_tags('product') }} {% endblock %} - {% set productId = attr('product', 'id') %} -{% block title %} - {{ attr('product', 'title') }} -{% endblock %} {% set product = resources('/api/front/products/' ~ productId) %} {% set productCategory = product.productCategories|filter(c => c.defaultCategory)|first.category %} @@ -32,7 +28,7 @@
-

{{ attr('product', 'title') }}

+

{{ BetterSeoPageH1("product", productId)}}

{% set chapo = attr('product', 'chapo') %} {% if chapo %}
{{ chapo }}