From ece25cf15c59d51592acef016ab9880a43484c08 Mon Sep 17 00:00:00 2001
From: Eloi Perdereau <eloi@perdereau.eu>
Date: Thu, 26 Nov 2020 16:54:06 +0100
Subject: [PATCH] move netlify identity redirect script to scripts.html

---
 _includes/scripts.html | 12 ++++++++++++
 _pages-jardin/index.md | 11 -----------
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/_includes/scripts.html b/_includes/scripts.html
index 5530028..90b047f 100644
--- a/_includes/scripts.html
+++ b/_includes/scripts.html
@@ -37,3 +37,15 @@
     <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/_pages-jardin/index.md b/_pages-jardin/index.md
index 58b137f..0be71e3 100644
--- a/_pages-jardin/index.md
+++ b/_pages-jardin/index.md
@@ -36,17 +36,6 @@ feature_row:
     btn_class: "btn--warning"
     btn_label: "<i class='fas fa-music'></i> Infos"
 ---
-<script>
-  if (window.netlifyIdentity) {
-    window.netlifyIdentity.on("init", user => {
-      if (!user) {
-        window.netlifyIdentity.on("login", () => {
-          document.location.href = "/lepuget/";
-        });
-      }
-    });
-  }
-</script>
 
 {% include feature_row %}
 
-- 
GitLab