From 1ff8060debd9623580281f6cb75be71616cfbf7d Mon Sep 17 00:00:00 2001 From: Nicolas Braud-Santoni <nicolas@braud-santoni.eu> Date: Thu, 7 Dec 2017 16:31:29 +0100 Subject: [PATCH] templates: Chargement quasi-asynchrone du script de navbar MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Utiliser `async` serait plus efficace, mais demanderait de modifier le script (il y aurait une « race condition » avec l'évènement `DOMContentLoaded`) --- templates/page.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/page.tmpl b/templates/page.tmpl index a876f44..a48b008 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -37,6 +37,7 @@ <link rel="next" href="<TMPL_VAR NEXTURL>" title="<TMPL_VAR NEXTTITLE>" /> </TMPL_IF> </TMPL_LOOP> + <script defer src="<TMPL_VAR BASEURL>assets/scripts.js" type="text/javascript"></script> </head> <body class=""> <div class="body-wrapper"> @@ -226,6 +227,5 @@ <!-- <TMPL_IF HTML5></article><TMPL_ELSE></div></TMPL_IF> --> </div><!-- body-wrapper --> -<script src="<TMPL_VAR BASEURL>assets/scripts.js" type="text/javascript"></script> </body> </html> -- 2.39.5