base.html.twig 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. {% set theme_config = attribute(config.themes, config.system.pages.theme) %}
  2. <!DOCTYPE html>
  3. <html lang="{{ grav.language.getActive ?: grav.config.site.default_lang }}">
  4. <head>
  5. {% block head %}
  6. <meta charset="utf-8" />
  7. <title>{% if header.title %}{{ header.title|e('html') }} | {% endif %}{{ site.title|e('html') }}</title>
  8. {% include 'partials/metadata.html.twig' %}
  9. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
  10. <link rel="icon" type="image/png" href="{{ url('theme://images/favicon.png') }}" />
  11. <link rel="canonical" href="{{ page.url(true, true) }}" />
  12. {% block stylesheets %}
  13. {% do assets.addCss('theme://css/pure-0.5.0/grids-min.css', 103) %}
  14. {% do assets.addCss('theme://css-compiled/nucleus.css', 102) %}
  15. {% do assets.addCss('theme://css-compiled/template.css', 101) %}
  16. {% do assets.addCss('theme://css/custom.css', 100) %}
  17. {% do assets.addCss('theme://css/font-awesome.min.css', 100) %}
  18. {% do assets.addCss('theme://css/slidebars.min.css') %}
  19. {% if browser.getBrowser == 'msie' and browser.getVersion == 10 %}
  20. {% do assets.addCss('theme://css/nucleus-ie10.css') %}
  21. {% endif %}
  22. {% if browser.getBrowser == 'msie' and browser.getVersion >= 8 and browser.getVersion <= 9 %}
  23. {% do assets.addCss('theme://css/nucleus-ie9.css') %}
  24. {% do assets.addJs('theme://js/html5shiv-printshiv.min.js') %}
  25. {% endif %}
  26. {% endblock %}
  27. {% block javascripts %}
  28. {% do assets.addJs('jquery', 101) %}
  29. {% do assets.addJs('theme://js/modernizr.custom.71422.js', 100) %}
  30. {% do assets.addJs('theme://js/antimatter.js') %}
  31. {% do assets.addJs('theme://js/slidebars.min.js') %}
  32. {% endblock %}
  33. {% block assets deferred %}
  34. {{ assets.css()|raw }}
  35. {{ assets.js()|raw }}
  36. {% endblock %}
  37. {% endblock head %}
  38. </head>
  39. <body id="top" class="{{ page.header.body_classes }}">
  40. <div id="sb-site">
  41. {% block header %}
  42. <header id="header">
  43. <div id="logo">
  44. {% for logo in page.header.content %}
  45. <img src='{{ page.media[logo.media_order].url|e }}' alt="{{ config.site.title }}" />
  46. {{ dump(page.media) }}
  47. {% endfor %}
  48. {# marche pas
  49. {% for image in page.header.media_order %}
  50. {% if loop.first %}
  51. <img src="{{ image.url}}" alt="{{ config.site.title }}"/>
  52. {% endif %}
  53. {% if loop.last %}
  54. <img src="{{ image.url}}" alt="{{ config.site.title }}"/>
  55. {% endif %}
  56. {% endfor %}
  57. #}
  58. {# {% if page.header.media_order %}
  59. <img src="{{ page.header.media_order|first }}" alt="{{ config.site.title }}"/>
  60. {% endif %}
  61. <img src="{{page.media[programme.logo].url|e }}" alt="logo du programme {{programme.nom_du_programme}}" />
  62. #}
  63. {# ça, ça marche si une seule image dans content de Home. Si 2 images, marche plus.>>>devient un tableau!
  64. il faut trouver un moyen de lui dire: tu prends la première puis tu prends la 2e du tableau media_order.
  65. J'ai rajouter "array: true" dans default.yaml pour qu'il voi plusieurs images. mais ne sont pas dans header. Elles apparaissent
  66. <img src="{{ page.header.media_order }}" alt="{{ config.site.title }}"/>
  67. #}
  68. {# <img src="EPAU_logo_EPAU_vecto-seul.svg"/>
  69. <h3><a href="{{ base_url == '' ? '/' : base_url }}">{{ config.site.title }}</a></h3>
  70. #}
  71. </div>
  72. <div id="navbar">
  73. {% block header_extra %}{% endblock %}
  74. {% if config.plugins.langswitcher.enabled %}
  75. {% include 'partials/langswitcher.html.twig' %}
  76. {% endif %}
  77. {% block header_navigation %}
  78. {% include 'partials/navigation.html.twig' %}
  79. {% endblock %}
  80. <span class="panel-activation sb-toggle-left navbar-left menu-btn fa fa-bars"></span>
  81. </div>
  82. </header>
  83. {% endblock %}
  84. {% block showcase %}{% endblock %}
  85. {% block body %}
  86. <section id="body" class="{{ class }}">
  87. {% block content %}{% endblock %}
  88. </section>
  89. {% endblock %}
  90. {% block footer %}
  91. <footer id="footer">
  92. <div class="totop">
  93. <span><a href="#" id="toTop"><i class="fa fa-arrow-up"></i></a></span>
  94. </div>
  95. <p><a href="http://getgrav.org">Grav</a> was <i class="fa fa-code"></i> with <i class="fa fa-heart"></i> by <a href="http://www.rockettheme.com">RocketTheme</a>.</p>
  96. </footer>
  97. {% endblock %}
  98. </div>
  99. {% block sidebar_navigation %}
  100. <div class="sb-slidebar sb-left sb-width-thin">
  101. <div id="panel">
  102. {% include 'partials/navigation.html.twig' %}
  103. </div>
  104. </div>
  105. {% endblock %}
  106. {% block bottom %}
  107. <script>
  108. $(function () {
  109. $(document).ready(function() {
  110. $.slidebars({
  111. hideControlClasses: true,
  112. scrollLock: true
  113. });
  114. });
  115. });
  116. </script>
  117. {{ assets.js('bottom')|raw }}
  118. {% endblock %}
  119. </body>
  120. </html>