templates/base.html.twig line 1

Open in your IDE?
  1.  
  2.  {% if post.id is defined and post.updatedAt is defined %}
  3.     {% set postIdentifier = post.id ~ ';' ~ post.updatedAt|date('d-m-Y-H-i-s') %}
  4. {% else %}
  5.     {% if blogHomes is defined %}
  6.         {% set postIdentifier = 'bloghome_general' %}
  7.     {% elseif cform is defined %}
  8.         {% set postIdentifier = 'contact' %}
  9.     {% else %}
  10.         {% set postIdentifier = random(0, 1000) %}
  11.     {% endif %}
  12. {% endif %}
  13. {% set letstalkType = post.letstalkType is defined and post.letstalkType is not null and post.letstalkType is not empty and post.letstalkType != 'none' ? post.letstalkType : null %}
  14. {% if letstalkType == 'random' %}
  15.     {% set letstalkType = random(['site', 'seo']) %}
  16. {% endif %}
  17. <!DOCTYPE html>
  18. <html lang="fr" prefix="{% block og_prefix %}og:https://ogp.me/ns/article#{% endblock %}">
  19.     <head>
  20.         {% cache 'tarteaucitron_init' ttl(31536000) %}
  21.         {{ include('blocks/_tarteaucitron_init.html.twig') }}
  22.         {% endcache %}
  23.         <!-- Google Tag Manager -->
  24.         <script>
  25.         window.dataLayer = window.dataLayer || [];
  26.         window.dataLayer.push({
  27.             'gtm.start': new Date().getTime(),
  28.             event: 'gtm.js'
  29.         });
  30.         window.addEventListener('load', function () {
  31.             function loadGTM() {
  32.             var j = document.createElement('script');
  33.             j.async = true;
  34.             j.src = 'https://www.googletagmanager.com/gtm.js?id=GTM-TBHL2LQ';
  35.             document.head.appendChild(j);
  36.             }
  37.             if ('requestIdleCallback' in window) {
  38.             requestIdleCallback(loadGTM);
  39.             } else {
  40.             setTimeout(loadGTM, 3000);
  41.             }
  42.         });
  43.         </script>
  44.         <!-- End Google Tag Manager -->
  45.         <meta charset="UTF-8">        
  46.         <link rel="canonical" href="{% block canonical_url %}{% cache 'canonical_url;' ~ postIdentifier ttl(31536000) %}{{ url(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) }}{% endcache %}{% endblock %}"/>
  47.         <title>
  48.             {%- block title_tag %}{% endblock -%}
  49.         </title>
  50.         <meta name="description" content="{% block description_tag %}{% endblock %}">
  51.         <meta name="viewport" content="width=device-width, initial-scale=1">
  52.         <link rel="icon" type="image/png" href="{{asset('/images/main/favicon.png') }}"/>
  53.         {# cache 'critical_css;' ~ postIdentifier ttl(31536000) %}
  54.         {% if app.request.attributes.get('_route') != 'show_portfolio' %}
  55.             <style>{{ inline_css('css/critical.css') }}</style>
  56.         {% else %}
  57.             <style>{{ inline_css('css/critical-portfolio.css') }}</style>
  58.         {% endif %}
  59.         {% endcache #}
  60.         <link rel="stylesheet" href="{{ asset('css/main.css?v=' ~ assets_version) }}">
  61.         <link rel="preload" href="{{ asset('css/fonts.css?v=' ~ assets_version) }}" as="style" onload="this.onload=null;this.rel='stylesheet'">
  62.         <link rel="preload" href="{{asset('tarteaucitron/tarteaucitron.js-master/css/tarteaucitron.css?v=' ~ assets_version) }}" as="style" onload="this.onload=null;this.rel='stylesheet'">
  63.         {% block internal_stylesheet %}{% endblock %}
  64.         {% block external_stylesheet %}{% endblock %}
  65.         {% block robots %}{% endblock %}
  66.         <script id="schema-org" type="application/ld+json"></script>
  67.         {% include('blocks/_open_graph.html.twig')with {
  68.             title_tag : block('title_tag'),
  69.             description_tag: block('description_tag'),
  70.             canonical_url: block('canonical_url')
  71.         } %}
  72.     </head>
  73.     <body>
  74.         <!-- Google Tag Manager (noscript) -->
  75.         <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-TBHL2LQ"
  76.         height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
  77.         <!-- End Google Tag Manager (noscript) -->
  78.         <div class="body-inner">
  79.             {% cache 'header;' ~ postIdentifier ttl(31536000) %}
  80.             {{ include('blocks/_header.html.twig') }}
  81.             {% endcache %}
  82.             <main>
  83.                 {% block content %}{% endblock %}
  84.                 {% block letstalk_banner %}{% endblock %}
  85.             </main>
  86.             {% cache 'footer;' ~ postIdentifier ttl(31536000) %}
  87.             {% include('blocks/_footer.html.twig') %}
  88.             {% endcache %}
  89.         </div>
  90.         <script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
  91.         <script type="text/javascript" src="{{ asset('js/main.min.js?v=' ~ assets_version) }}"></script>
  92.     </body>
  93. </html>