jcarrier-theme

A Grav CMS theme for <https://jacynthecarrier.com>.
git clone git://soucy.cc/jcarrier-theme.git
Log | Files | Refs | README | LICENSE

commit d3be39b57e2f4ba3c87c0d338ce39afa10ac6fe5
parent 7f32d633e981f04b4b13932f1326bb0a2434e635
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Sat, 17 Oct 2020 22:59:52 -0400

Include the main js at the end of the body

Diffstat:
Mtemplates/partials/base.html.twig | 108+++++++++++++++++++++++++++++++++++++++++--------------------------------------
1 file changed, 56 insertions(+), 52 deletions(-)

diff --git a/templates/partials/base.html.twig b/templates/partials/base.html.twig @@ -1,64 +1,68 @@ {% set theme_config = attribute(config.themes, config.system.pages.theme) %} <!DOCTYPE html> -<html lang="{{ grav.language.getActive ?: grav.config.site.default_lang }}"> - <head> - {% block head %} - <meta charset="utf-8" /> - <title>{% if header.title %}{{ header.title|e('html') }} | {% endif %}{{ site.title|e('html') }}</title> +<html class="no-js" lang="{{ grav.language.getActive ?: grav.config.site.default_lang }}"> + <head> + {% block head %} + <meta charset="utf-8" /> + <title>{% if header.title %}{{ header.title|e('html') }} | {% endif %}{{ site.title|e('html') }}</title> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - {% include 'partials/metadata.html.twig' %} + <meta http-equiv="X-UA-Compatible" content="IE=edge"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + {% include 'partials/metadata.html.twig' %} - <link rel="icon" type="image/png" href="{{ url('theme://images/logo.png') }}" /> - <link rel="canonical" href="{{ page.url(true, true) }}" /> - {% endblock head %} + <link rel="icon" type="image/png" href="{{ url('theme://images/logo.png') }}" /> + <link rel="canonical" href="{{ page.url(true, true) }}" /> + {% endblock head %} - {% block stylesheets %} - {% do assets.addCss('theme://css/index.css', 98) %} - {% endblock %} + {% block stylesheets %} + {% do assets.addCss('theme://css/index.css', 98) %} + {% endblock %} - {% block javascripts %} - {% do assets.addJs('jquery', 100) %} - {% endblock %} + {% block javascripts %} + {% do assets.addJs('jquery', 100) %} + {% endblock %} + + {% block assets deferred %} + {{ assets.css()|raw }} + {{ assets.js()|raw }} + {% endblock %} + </head> - {% block assets deferred %} - {{ assets.css()|raw }} - {{ assets.js()|raw }} + <body id="t" class="layout {{ page.header.body_classes }}"> + <div class="layout__inner"> + {% block header %} + <header class="header-banner layout__aside"> + <a class="logo" href="{{ home_url }}"> + {{ config.site.title }} + </a> + {% block header_navigation %} + {% include 'partials/navigation.html.twig' %} + {% endblock %} + </header> + {% endblock %} + + <div class="layout__main"> + {% block body %} + <main id="c"> + {% block content %}{% endblock %} + </main> {% endblock %} - </head> - <body id="t" class="layout {{ page.header.body_classes }}"> - <div class="layout__inner"> - {% block header %} - <header class="header-banner layout__aside"> - <a class="logo" href="{{ home_url }}"> - {{ config.site.title }} - </a> - {% block header_navigation %} - <nav class="nav"> - {% include 'partials/navigation.html.twig' %} - </nav> - {% endblock %} - </header> - {% endblock %} - <div class="layout__main"> - {% block body %} - <main id="body"> - {% block content %}{% endblock %} - </main> - {% endblock %} + {% block footer %} + <footer class="footer-banner"> + <p> + <small>Copyright &copy; <time>{{ now|date('Y') }}</time> Jacynthe Carrier.</small><br/> + <small>Tous droits réservés.</small> + </p> + </footer> + {% endblock %} + </div> - {% block footer %} - <footer class="footer-banner"> - <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> - </footer> - {% endblock %} - </div> + {% do assets.addJs('theme://js/index.js', {group: 'bottom'}) %} - {% block bottom %} - {{ assets.js('bottom')|raw }} - {% endblock %} - </div> - </body> + {% block bottom %} + {{ assets.js('bottom')|raw }} + {% endblock %} + </div> + </body> </html>