vendor/shopware/platform/src/Storefront/Resources/views/storefront/layout/meta.html.twig line 1

Open in your IDE?
  1. {% block layout_head_inner %}
  2.     {% set metaInformation = page.metaInformation %}
  3.     {% set basicConfig = config('core.basicInformation') %}
  4.     {% set maxLength = config('seo.descriptionMaxLength') %}
  5.     {% set metaDescription = metaInformation.metaDescription|striptags|trim|u.truncate(maxLength ?? 160, '…') %}
  6.     {% set metaTitle = metaInformation.metaTitle|striptags|trim %}
  7.     {% set metaKeywords = metaInformation.metaKeywords|striptags|trim %}
  8.     <head>
  9.         {% block layout_head_meta_tags %}
  10.             {% block layout_head_meta_tags_charset %}
  11.                 <meta charset="utf-8">
  12.             {% endblock %}
  13.             {% block layout_head_meta_tags_viewport %}
  14.                 <meta name="viewport"
  15.                       content="width=device-width, initial-scale=1, shrink-to-fit=no">
  16.             {% endblock %}
  17.             {% block layout_head_meta_tags_general %}
  18.                 <meta name="author"
  19.                       content="{% block layout_head_meta_tags_general_author %}{{ metaInformation.author|striptags }}{% endblock %}"/>
  20.                 <meta name="robots"
  21.                       content="{% block layout_head_meta_tags_robots %}{{ metaInformation.robots }}{% endblock %}"/>
  22.                 <meta name="revisit-after"
  23.                       content="{% block layout_head_meta_tags_general_revisit %}{{ metaInformation.revisit|striptags }}{% endblock %}"/>
  24.                 <meta name="keywords"
  25.                       content="{% block layout_head_meta_tags_keywords %}{{ metaKeywords }}{% endblock %}"/>
  26.                 <meta name="description"
  27.                       content="{% block layout_head_meta_tags_description %}{{ metaDescription }}{% endblock %}"/>
  28.             {% endblock %}
  29.             {% block layout_head_meta_tags_opengraph %}
  30.                 <meta property="og:type"
  31.                       content="{% block layout_head_meta_tags_type_og %}website{% endblock %}"/>
  32.                 <meta property="og:site_name"
  33.                       content="{% block layout_head_meta_tags_sitename_og %}{{ basicConfig.shopName }}{% endblock %}"/>
  34.                 <meta property="og:title"
  35.                       content="{% block layout_head_meta_tags_title_og %}{{ metaTitle }}{% endblock %}"/>
  36.                 <meta property="og:description"
  37.                       content="{% block layout_head_meta_tags_description_og %}{{ metaDescription }}{% endblock %}"/>
  38.                 <meta property="og:image"
  39.                       content="{% block layout_head_meta_tags_image_og %}{{ theme_config('sw-logo-desktop') }}{% endblock %}"/>
  40.                 <meta name="twitter:card"
  41.                       content="{% block layout_head_meta_tags_card_twitter %}summary{% endblock %}"/>
  42.                 <meta name="twitter:site"
  43.                       content="{% block layout_head_meta_tags_sitename_twitter %}{{ basicConfig.shopName }}{% endblock %}"/>
  44.                 <meta name="twitter:title"
  45.                       content="{% block layout_head_meta_tags_title_twitter %}{{ metaTitle }}{% endblock %}"/>
  46.                 <meta name="twitter:description"
  47.                       content="{% block layout_head_meta_tags_description_twitter %}{{ metaDescription }}{% endblock %}"/>
  48.                 <meta name="twitter:image"
  49.                       content="{% block layout_head_meta_tags_image_twitter %}{{ theme_config('sw-logo-desktop') }}{% endblock %}"/>
  50.             {% endblock %}
  51.             {% block layout_head_meta_tags_schema_webpage %}
  52.                 <meta itemprop="copyrightHolder"
  53.                       content="{% block layout_head_meta_tags_copyright_holder %}{{ basicConfig.shopName }}{% endblock %}"/>
  54.                 <meta itemprop="copyrightYear"
  55.                       content="{% block layout_head_meta_tags_copyright_year %}{{ metaInformation.copyrightYear|striptags }}{% endblock %}"/>
  56.                 <meta itemprop="isFamilyFriendly"
  57.                       content="{% block layout_head_meta_tags_family_friendly %}{% if basicConfig.familyFriendly %}true{% else %}false{% endif %}{% endblock %}"/>
  58.                 <meta itemprop="image"
  59.                       content="{% block layout_head_meta_tags_image_meta %}{{ theme_config('sw-logo-desktop') }}{% endblock %}"/>
  60.             {% endblock %}
  61.             {% block layout_head_meta_tags_hreflangs %}
  62.                 {% for link in hrefLang %}
  63.                     <link rel="alternate" hreflang="{{ link.locale }}" href="{{ link.url }}" />
  64.                 {% endfor %}
  65.             {% endblock %}
  66.         {% endblock %}
  67.         {% block layout_head_favicon %}
  68.             <link rel="shortcut icon"
  69.                   href="{{ theme_config('sw-logo-favicon') }}">
  70.         {% endblock %}
  71.         {% block layout_head_apple %}
  72.             {% if theme_config('sw-logo-share') %}
  73.             <link rel="apple-touch-icon"
  74.                   sizes="180x180"
  75.                   href="{{ theme_config('sw-logo-share') }}">
  76.             {% endif %}
  77.         {% endblock %}
  78.         {% block layout_head_android %}
  79.             {# @deprecated tag:v6.5.0 - Use the block above, "layout_head_apple", instead #}
  80.         {% endblock %}
  81.         {% block layout_head_canonical %}
  82.             {% if page.metaInformation.canonical %}
  83.                 <link rel="canonical" href="{{ page.metaInformation.canonical }}" />
  84.             {% endif %}
  85.         {% endblock %}
  86.         {% block layout_head_title %}
  87.             <title itemprop="name">{% apply spaceless %}
  88.                 {% block layout_head_title_inner %}
  89.                     {{ metaTitle }}
  90.                 {% endblock %}
  91.             {% endapply %}</title>
  92.         {% endblock %}
  93.         {% block layout_head_stylesheet %}
  94.             {% if isHMRMode %}
  95.                 {# CSS will be loaded from the JS automatically #}
  96.             {% else %}
  97.                 {% set assets = theme_config('assets.css') %}
  98.                 {% for file in assets %}
  99.                     <link rel="stylesheet"
  100.                       href="{{ asset(file, 'theme') }}">
  101.                 {% endfor %}
  102.             {% endif %}
  103.         {% endblock %}
  104.         {% block layout_head_javascript_feature %}
  105.             {% sw_include "@Storefront/storefront/component/feature.html.twig" %}
  106.         {% endblock %}
  107.         {# Block for tracking scripts which are required to include in the `head` section of the document #}
  108.         {% block layout_head_javascript_tracking %}
  109.             {% sw_include "@Storefront/storefront/component/analytics.html.twig" %}
  110.         {% endblock %}
  111.         {% block layout_head_javascript_recaptcha %}
  112.             {% sw_include "@Storefront/storefront/component/recaptcha.html.twig" %}
  113.         {% endblock %}
  114.         {% block layout_head_javascript_token %}
  115.         {% endblock %}
  116.         {% if feature('FEATURE_NEXT_15917') %}
  117.             {% block layout_head_javascript_router %}
  118.                 {# Register all routes that will be needed in JavaScript to the window.router object #}
  119.                 <script>
  120.                     window.activeNavigationId = '{{ page.header.navigation.active.id }}';
  121.                     window.router = {
  122.                         'frontend.cart.offcanvas': '{{ path('frontend.cart.offcanvas') }}',
  123.                         'frontend.cookie.offcanvas': '{{ path('frontend.cookie.offcanvas') }}',
  124.                         'frontend.checkout.finish.page': '{{ path('frontend.checkout.finish.page') }}',
  125.                         'frontend.checkout.info': '{{ path('frontend.checkout.info') }}',
  126.                         'frontend.menu.offcanvas': '{{ path('frontend.menu.offcanvas') }}',
  127.                         'frontend.cms.page': '{{ path('frontend.cms.page') }}',
  128.                         'frontend.cms.navigation.page': '{{ path('frontend.cms.navigation.page') }}',
  129.                         'frontend.account.addressbook': '{{ path('frontend.account.addressbook') }}',
  130.                         'frontend.csrf.generateToken': '{{ path('frontend.csrf.generateToken') }}',
  131.                         'frontend.country.country-data': '{{ path('frontend.country.country.data') }}',
  132.                         'frontend.store-api.proxy': '{{ path('frontend.store-api.proxy') }}',
  133.                     };
  134.                     window.storeApiProxyToken = '{{ sw_csrf("frontend.store-api.proxy", {"mode": "token"}) }}';
  135.                     window.salesChannelId = '{{ app.request.attributes.get('sw-sales-channel-id') }}';
  136.                 </script>
  137.             {% endblock %}
  138.             {% block layout_head_javascript_breakpoints %}
  139.                 {# Register the available viewport breakpoints the window.breakpoints object #}
  140.                 <script>
  141.                     {% set breakpoint = {
  142.                         'xs': theme_config('breakpoint.xs'),
  143.                         'sm': theme_config('breakpoint.sm'),
  144.                         'md': theme_config('breakpoint.md'),
  145.                         'lg': theme_config('breakpoint.lg'),
  146.                         'xl': theme_config('breakpoint.xl')
  147.                     } %}
  148.                     window.breakpoints = {{ breakpoint|json_encode()|raw }};
  149.                 </script>
  150.             {% endblock %}
  151.             {% block layout_head_javascript_csrf %}
  152.                 <script>
  153.                     window.csrf = {
  154.                         'enabled': '{{ shopware.csrfEnabled }}',
  155.                         'mode': '{{ shopware.csrfMode }}'
  156.                     }
  157.                 </script>
  158.             {% endblock %}
  159.             {% if config('core.cart.wishlistEnabled') %}
  160.                 {% block layout_head_javascript_wishlist_state %}
  161.                     <script>
  162.                         window.customerLoggedInState = {{ context.customer is not null and not context.customer.guest ? 1 : 0 }};
  163.                         window.wishlistEnabled = {{ config('core.cart.wishlistEnabled') }};
  164.                     </script>
  165.                 {% endblock %}
  166.             {% endif %}
  167.             {# @internal tag:v6.5.0 - jQuery will be removed from the core. This block can be used to add jQuery as a `<script>`. #}
  168.             {% block layout_head_javascript_jquery %}
  169.             {% endblock %}
  170.             {% block layout_head_javascript_hmr_mode %}
  171.                 {% if isHMRMode %}
  172.                     <script type="text/javascript" src="/_webpack_hot_proxy_/js/vendor-node.js" defer></script>
  173.                     <script type="text/javascript" src="/_webpack_hot_proxy_/js/vendor-shared.js" defer></script>
  174.                     <script type="text/javascript" src="/_webpack_hot_proxy_/js/runtime.js" defer></script>
  175.                     <script type="text/javascript" src="/_webpack_hot_proxy_/js/app.js" defer></script>
  176.                     {# The storefront entry is a combined entry point which contains all plugins & themes #}
  177.                     <script type="text/javascript" src="/_webpack_hot_proxy_/js/storefront.js" defer></script>
  178.                 {% else %}
  179.                     {% for file in theme_config('assets.js') %}
  180.                         <script type="text/javascript" src="{{ asset(file, 'theme') }}" defer></script>
  181.                     {% endfor %}
  182.                 {% endif %}
  183.             {% endblock %}
  184.         {% endif %}
  185.     </head>
  186. {% endblock %}