base.html.twig 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. {% do assets.addCss('https://cdn.jsdelivr.net/npm/[email protected]/dist/css/select2.min.css') %}
  20. {% do assets.addCss('theme://css/s2-docs.css', 100) %}
  21. {% do assets.addCss('theme://css/theme.css',100) %}
  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.addCss('theme://css/pure-0.5.0/grids-min.css') %}
  25. {% do assets.addJs('theme://js/html5shiv-printshiv.min.js') %}
  26. {% endif %}
  27. {{ assets.css() }}
  28. {% endblock %}
  29. {% block javascripts %}
  30. {% do assets.addJs('jquery',101) %}
  31. {% do assets.addJs('theme://js/modernizr.custom.71422.js',100) %}
  32. {% do assets.addJs('https://cdn.jsdelivr.net/npm/[email protected]/dist/js/select2.full.min.js', 100) %}
  33. {% do assets.addJs('https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js', 100) %}
  34. {% do assets.addJs('theme://js/featherlight.min.js') %}
  35. {% do assets.addJs('theme://js/clipboard.min.js') %}
  36. {% do assets.addJs('theme://js/jquery.scrollbar.min.js') %}
  37. {% do assets.addJs('theme://js/learn.js') %}
  38. {% do assets.addJs('theme://js/data-fill-from.js') %}
  39. {{ assets.js() }}
  40. {% include "partials/js/source-states.html.twig" %}
  41. {% endblock %}
  42. {% endblock %}
  43. </head>
  44. <body class="searchbox-hidden {{ page.header.body_classes }}" data-url="{{ page.route }}">
  45. {% block sidebar %}
  46. <nav id="sidebar">
  47. <div id="header-wrapper">
  48. <div id="header">
  49. <a id="logo" href="{{ theme_config.home_url ?: base_url_absolute }}">{% include 'partials/logo.html.twig' %}</a>
  50. <div class="searchbox">
  51. <label for="search-by"><i class="fa fa-search"></i></label>
  52. <input id="search-by" type="text" placeholder="{{ 'THEME_LEARN2_SEARCH_DOCUMENTATION'|t }}"
  53. data-search-input="{{ base_url_relative }}/search.json/query"/>
  54. <span data-search-clear><i class="fa fa-close"></i></span>
  55. </div>
  56. </div>
  57. </div>
  58. {% include 'partials/sidebar.html.twig' %}
  59. </nav>
  60. {% endblock %}
  61. {% block body %}
  62. <section id="body">
  63. <div id="overlay"></div>
  64. <div class="padding highlightable">
  65. <a href="#" id="sidebar-toggle" data-sidebar-toggle><i class="fa fa-2x fa-bars"></i></a>
  66. {% block topbar %}{% if theme_config.github.position == 'top' or config.plugins.breadcrumbs.enabled %}
  67. <div id="top-bar">
  68. {% if theme_config.github.position == 'top' %}
  69. <div id="top-github-link">
  70. {% include 'partials/github_link.html.twig' %}
  71. </div>
  72. {% endif %}
  73. {% if config.plugins.breadcrumbs.enabled %}
  74. {% include 'partials/breadcrumbs.html.twig' %}
  75. {% endif %}
  76. </div>
  77. {% endif %}{% endblock %}
  78. {% block content %}{% endblock %}
  79. {% block footer %}
  80. {% if theme_config.github.position == 'bottom' %}
  81. {% include 'partials/github_note.html.twig' %}
  82. {% endif %}
  83. {% endblock %}
  84. </div>
  85. {% block navigation %}{% endblock %}
  86. </section>
  87. {% endblock %}
  88. {% block analytics %}
  89. {% if theme_config.google_analytics_code %}
  90. {% include 'partials/analytics.html.twig' %}
  91. {% endif %}
  92. {% endblock %}
  93. </body>
  94. </html>