vendor/shopware/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.             <link rel="apple-touch-icon"
  73.                   sizes="180x180"
  74.                   href="{{ theme_config('sw-logo-share') }}">
  75.         {% endblock %}
  76.         {% block layout_head_android %}
  77.             {# @deprecated tag:v6.5.0 - Use the block above, "layout_head_apple", instead #}
  78.         {% endblock %}
  79.         {% block layout_head_canonical %}
  80.             {% if page.metaInformation.canonical %}
  81.                 <link rel="canonical" href="{{ page.metaInformation.canonical }}" />
  82.             {% endif %}
  83.         {% endblock %}
  84.         {% block layout_head_title %}
  85.             <title itemprop="name">{% apply spaceless %}
  86.                 {% block layout_head_title_inner %}
  87.                     {{ metaTitle }}
  88.                 {% endblock %}
  89.             {% endapply %}</title>
  90.         {% endblock %}
  91.         {% block layout_head_stylesheet %}
  92.             {% if isHMRMode %}
  93.                 {# CSS will be loaded from the JS automatically #}
  94.             {% else %}
  95.                 {% set assets = theme_config('assets.css') %}
  96.                 {% for file in assets %}
  97.                     <link rel="stylesheet"
  98.                       href="{{ asset(file, 'theme') }}">
  99.                 {% endfor %}
  100.             {% endif %}
  101.         {% endblock %}
  102.         {% block layout_head_javascript_feature %}
  103.             {% sw_include "@Storefront/storefront/component/feature.html.twig" %}
  104.         {% endblock %}
  105.         {# Block for tracking scripts which are required to include in the `head` section of the document #}
  106.         {% block layout_head_javascript_tracking %}
  107.             {% sw_include "@Storefront/storefront/component/analytics.html.twig" %}
  108.         {% endblock %}
  109.         {% block layout_head_javascript_recaptcha %}
  110.             {% sw_include "@Storefront/storefront/component/recaptcha.html.twig" %}
  111.         {% endblock %}
  112.         {% block layout_head_javascript_token %}
  113.         {% endblock %}
  114.         {% if feature('FEATURE_NEXT_15917') %}
  115.             {% block layout_head_javascript_router %}
  116.                 {# Register all routes that will be needed in JavaScript to the window.router object #}
  117.                 <script>
  118.                     window.activeNavigationId = '{{ page.header.navigation.active.id }}';
  119.                     window.router = {
  120.                         'frontend.cart.offcanvas': '{{ path('frontend.cart.offcanvas') }}',
  121.                         'frontend.cookie.offcanvas': '{{ path('frontend.cookie.offcanvas') }}',
  122.                         'frontend.checkout.finish.page': '{{ path('frontend.checkout.finish.page') }}',
  123.                         'frontend.checkout.info': '{{ path('frontend.checkout.info') }}',
  124.                         'frontend.menu.offcanvas': '{{ path('frontend.menu.offcanvas') }}',
  125.                         'frontend.cms.page': '{{ path('frontend.cms.page') }}',
  126.                         'frontend.cms.navigation.page': '{{ path('frontend.cms.navigation.page') }}',
  127.                         'frontend.account.addressbook': '{{ path('frontend.account.addressbook') }}',
  128.                         'frontend.csrf.generateToken': '{{ path('frontend.csrf.generateToken') }}',
  129.                         'frontend.country.country-data': '{{ path('frontend.country.country.data') }}',
  130.                         'frontend.store-api.proxy': '{{ path('frontend.store-api.proxy') }}',
  131.                     };
  132.                     window.storeApiProxyToken = '{{ sw_csrf("frontend.store-api.proxy", {"mode": "token"}) }}';
  133.                     window.salesChannelId = '{{ app.request.attributes.get('sw-sales-channel-id') }}';
  134.                 </script>
  135.             {% endblock %}
  136.             {% block layout_head_javascript_breakpoints %}
  137.                 {# Register the available viewport breakpoints the window.breakpoints object #}
  138.                 <script>
  139.                     {% set breakpoint = {
  140.                         'xs': theme_config('breakpoint.xs'),
  141.                         'sm': theme_config('breakpoint.sm'),
  142.                         'md': theme_config('breakpoint.md'),
  143.                         'lg': theme_config('breakpoint.lg'),
  144.                         'xl': theme_config('breakpoint.xl')
  145.                     } %}
  146.                     window.breakpoints = {{ breakpoint|json_encode()|raw }};
  147.                 </script>
  148.             {% endblock %}
  149.             {% block layout_head_javascript_csrf %}
  150.                 <script>
  151.                     window.csrf = {
  152.                         'enabled': '{{ shopware.csrfEnabled }}',
  153.                         'mode': '{{ shopware.csrfMode }}'
  154.                     }
  155.                 </script>
  156.             {% endblock %}
  157.             {% if config('core.cart.wishlistEnabled') %}
  158.                 {% block layout_head_javascript_wishlist_state %}
  159.                     <script>
  160.                         window.customerLoggedInState = {{ context.customer is not null and not context.customer.guest ? 1 : 0 }};
  161.                         window.wishlistEnabled = {{ config('core.cart.wishlistEnabled') }};
  162.                     </script>
  163.                 {% endblock %}
  164.             {% endif %}
  165.             {% block layout_head_javascript_jquery %}
  166.             {% endblock %}
  167.             {% block layout_head_javascript_hmr_mode %}
  168.                 {% if isHMRMode %}
  169.                     <script type="text/javascript" src="/_webpack_hot_proxy_/js/vendor-node.js" defer></script>
  170.                     <script type="text/javascript" src="/_webpack_hot_proxy_/js/vendor-shared.js" defer></script>
  171.                     <script type="text/javascript" src="/_webpack_hot_proxy_/js/runtime.js" defer></script>
  172.                     <script type="text/javascript" src="/_webpack_hot_proxy_/js/app.js" defer></script>
  173.                     {# The storefront entry is a combined entry point which contains all plugins & themes #}
  174.                     <script type="text/javascript" src="/_webpack_hot_proxy_/js/storefront.js" defer></script>
  175.                 {% else %}
  176.                     {% for file in theme_config('assets.js') %}
  177.                         <script type="text/javascript" src="{{ asset(file, 'theme') }}" defer></script>
  178.                     {% endfor %}
  179.                 {% endif %}
  180.             {% endblock %}
  181.         {% endif %}
  182.     </head>
  183. {% endblock %}