diff --git a/templates/_macros.html b/templates/_macros.html index 6eab1ab..e473e3d 100644 --- a/templates/_macros.html +++ b/templates/_macros.html @@ -32,17 +32,32 @@ {% endif %} {% endfor %} - {% if lang == "en"%} - swedish - {% else %} - english - {% endif %} + {% set hyper="on click halt the event then + set path to window.location.pathname js(path) + let arr = path.split('/'); + if (arr[1] == 'sv') { + arr.shift(); + arr.shift(); + } else if (arr[0] == 'sv') { + arr.shift(); + } else{ + arr[0] = 'sv'; + } + if (arr.slice(-1) == '' ) { + arr.pop(); + } + arr.unshift(window.location.origin); + return arr.join('/') end + log(it) + then set window.location to it"%} + {% if lang == "en" %} + swedish + {% else %} + swedish + {% endif %}