base.html.twig 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. {% set body_classes = body_class(['header-fixed', 'header-animated', 'header-dark', 'header-transparent', 'sticky-footer']) %}
  2. {% set grid_size = theme_var('grid-size') %}
  3. {% set compress = theme_var('production_mode') ? '.min.css' : '.css' %}
  4. <!DOCTYPE html>
  5. <html lang="{{ grav.language.getActive ?: grav.config.site.default_lang }}">
  6. <head>
  7. {% block head %}
  8. <meta charset="utf-8" />
  9. <title>{% if header.title %}{{ header.title|e('html') }} | {% endif %}{{ site.title|e('html') }}</title>
  10. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  11. <meta name="viewport" content="width=device-width, initial-scale=1">
  12. {% include 'partials/metadata.html.twig' %}
  13. <link rel="icon" type="image/png" href="{{ url('theme://images/favicon.png') }}" />
  14. <link rel="canonical" href="{{ page.url(true, true) }}" />
  15. {% block stylesheets %}
  16. {% do assets.addCss('theme://css-compiled/template.min.css'~compress) %}
  17. {% endblock %}
  18. {{ assets.css() }}
  19. {% block javascripts %}
  20. {% do assets.addJs('jquery', 101) %}
  21. {% do assets.addJs('theme://js/site.js', {group:'bottom'}) %}
  22. {% endblock %}
  23. {{ assets.js() }}
  24. {% endblock head %}
  25. </head>
  26. <body id="top" class="{% block body_classes %}{{ body_classes }}{% endblock %}">
  27. {% block header %}
  28. <header class="section">
  29. <h1><a href="{{ base_url == '' ? '/' : base_url }}">{{ config.site.title }}</a></h1>
  30. <nav class="navbar">
  31. {% block header_navigation %}
  32. {% include 'partials/navigation.html.twig' %}
  33. {% include 'partials/taxonomylist.html.twig' with { taxonomy: 'tag'} %}
  34. {% endblock %}
  35. </nav>
  36. </header>
  37. {% endblock %}
  38. <section id="start">
  39. {% block body %}
  40. <section id="body-wrapper" class="section">
  41. <section class="container {{ grid_size }}">
  42. {% block content %}{% endblock %}
  43. </section>
  44. </section>
  45. {% endblock %}
  46. </section>
  47. </div>
  48. {% block footer %}{% endblock %}
  49. {% block bottom %}
  50. {{ assets.js('bottom') }}
  51. {% endblock %}
  52. </body>