From 70f054c6b14738da74899f5dab063068ee62d2bf Mon Sep 17 00:00:00 2001 From: Eloi Perdereau <eloi@perdereau.eu> Date: Thu, 26 Nov 2020 17:07:59 +0100 Subject: [PATCH] move script in head --- _includes/scripts.html | 12 ------------ _layouts/default.html | 12 ++++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/_includes/scripts.html b/_includes/scripts.html index 90b047f..5530028 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -37,15 +37,3 @@ <script src="{{ script_path }}"></script> {% endfor %} {% endif %} - -<script> - if (window.netlifyIdentity) { - window.netlifyIdentity.on("init", user => { - if (!user) { - window.netlifyIdentity.on("login", () => { - document.location.href = "/lepuget/"; - }); - } - }); - } -</script> diff --git a/_layouts/default.html b/_layouts/default.html index 34c4e3f..6f019c9 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -12,6 +12,18 @@ <head> {% include head.html %} {% include head/custom.html %} + + <script> + if (window.netlifyIdentity) { + window.netlifyIdentity.on("init", user => { + if (!user) { + window.netlifyIdentity.on("login", () => { + document.location.href = "/lepuget/"; + }); + } + }); + } + </script> </head> <body class="layout--{{ page.layout | default: layout.layout }}{% if page.classes or layout.classes %}{{ page.classes | default: layout.classes | join: ' ' | prepend: ' ' }}{% endif %}"> -- GitLab