base.html.twig 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. {% set theme_config = attribute(config.themes, config.system.pages.theme) %}
  2. <!DOCTYPE html>
  3. <html lang="{{ grav.language.getLanguage ?: 'en' }}">
  4. <head>
  5. {% block head %}
  6. <meta charset="utf-8" />
  7. <title>{% if header.title %}{{ header.title }} | {% endif %}{{ site.title }}</title>
  8. {% include 'partials/metadata.html.twig' %}
  9. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no" />
  10. <link rel="alternate" type="application/atom+xml" href="{{ base_url_absolute}}/feed:atom" title="Atom Feed" />
  11. <link rel="alternate" type="application/rss+xml" href="{{ base_url_absolute}}/feed:rss" title="RSS Feed" />
  12. <link rel="icon" type="image/png" href="{{ url('theme://images/favicon.png') }}">
  13. {% block stylesheets %}
  14. {% do assets.addCss('theme://css-compiled/nucleus.css',102) %}
  15. {% do assets.addCss('theme://css-compiled/theme.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/featherlight.min.css') %}
  19. {% if browser.getBrowser == 'msie' and browser.getVersion >= 8 and browser.getVersion <= 9 %}
  20. {% do assets.addCss('theme://css/nucleus-ie9.css') %}
  21. {% do assets.addCss('theme://css/pure-0.5.0/grids-min.css') %}
  22. {% do assets.addJs('theme://js/html5shiv-printshiv.min.js') %}
  23. {% endif %}
  24. {{ assets.css() }}
  25. {% endblock %}
  26. {% block javascripts %}
  27. {% do assets.addJs('jquery',101) %}
  28. {% do assets.addJs('theme://js/modernizr.custom.71422.js',100) %}
  29. {% do assets.addJs('theme://js/featherlight.min.js') %}
  30. {% do assets.addJs('theme://js/clipboard.min.js') %}
  31. {% do assets.addJs('theme://js/jquery.scrollbar.min.js') %}
  32. {% do assets.addJs('theme://js/learn.js') %}
  33. {{ assets.js() }}
  34. {% endblock %}
  35. {% endblock %}
  36. </head>
  37. <body class="searchbox-hidden {{ page.header.body_classes }}" data-url="{{ page.route }}">
  38. {% block sidebar %}
  39. <nav id="sidebar">
  40. <div id="header-wrapper">
  41. <div id="header">
  42. <a id="logo" href="{{ theme_config.home_url ?: base_url_absolute }}">{% include 'partials/logo.html.twig' %}</a>
  43. <div class="searchbox">
  44. <label for="search-by"><i class="fa fa-search"></i></label>
  45. <input id="search-by" type="text" placeholder="{{ 'THEME_LEARN2_SEARCH_DOCUMENTATION'|t }}"
  46. data-search-input="{{ base_url_relative }}/search.json/query"/>
  47. <span data-search-clear><i class="fa fa-close"></i></span>
  48. </div>
  49. </div>
  50. </div>
  51. {% include 'partials/sidebar.html.twig' %}
  52. </nav>
  53. {% endblock %}
  54. {% block body %}
  55. <section id="body">
  56. <div id="overlay"></div>
  57. <div class="padding highlightable">
  58. <a href="#" id="sidebar-toggle" data-sidebar-toggle><i class="fa fa-2x fa-bars"></i></a>
  59. {% block topbar %}{% if theme_config.github.position == 'top' or config.plugins.breadcrumbs.enabled %}
  60. <div id="top-bar">
  61. {% if theme_config.github.position == 'top' %}
  62. <div id="top-github-link">
  63. {% include 'partials/github_link.html.twig' %}
  64. </div>
  65. {% endif %}
  66. {% if config.plugins.breadcrumbs.enabled %}
  67. {% include 'partials/breadcrumbs.html.twig' %}
  68. {% endif %}
  69. </div>
  70. {% endif %}{% endblock %}
  71. {% block content %}{% endblock %}
  72. {% block footer %}
  73. {% if theme_config.github.position == 'bottom' %}
  74. {% include 'partials/github_note.html.twig' %}
  75. {% endif %}
  76. {% endblock %}
  77. </div>
  78. {% block navigation %}{% endblock %}
  79. </section>
  80. {% endblock %}
  81. {% block analytics %}
  82. {% if theme_config.google_analytics_code %}
  83. {% include 'partials/analytics.html.twig' %}
  84. {% endif %}
  85. {% endblock %}
  86. </body>
  87. </html>