Skip to content
Snippets Groups Projects
Commit 55ea58d9 authored by Eloi Perdereau's avatar Eloi Perdereau
Browse files

netlify identity in scripts.html + fix locale

parent 8509a530
No related branches found
No related tags found
No related merge requests found
...@@ -37,3 +37,20 @@ ...@@ -37,3 +37,20 @@
<script src="{{ script_path }}"></script> <script src="{{ script_path }}"></script>
{% endfor %} {% endfor %}
{% endif %} {% endif %}
<script>
if (window.netlifyIdentity) {
window.netlifyIdentity.on("init", user => {
if (!user) {
window.netlifyIdentity.on("login", () => {
gotrueUser = window.netlifyIdentity.gotrue.currentUser()
if (gotrueUser.email == "judl@luminy.org") {
window.netlifyIdentity.logout();
} else {
document.location.href = "/lepuget/";
}
});
}
});
}
</script>
...@@ -8,12 +8,8 @@ ...@@ -8,12 +8,8 @@
<script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script> <script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>
</head> </head>
<body> <body>
<!-- Locale translate script -->
<script> <script>
import CMS from 'netlify-cms-app'; window.netlifyIdentity.setLocale("fr");
import { fr } from 'netlify-cms-locales';
CMS.registerLocale('fr', fr);
</script> </script>
<!-- Include the script that builds the page and powers Netlify CMS --> <!-- Include the script that builds the page and powers Netlify CMS -->
<script src="https://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js"></script> <script src="https://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js"></script>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment