logo

Grimgrains

[mirror] Plant-based cooking website <https://grimgrains.com/>
commit: 65e96e91cbc39e4c63ada8e71f305555990fe6c9
parent 30ba87c160aaa5a157fc80778349701345a31c1f
Author: microlith57 <microlith57@gmail.com>
Date:   Fri, 14 Jun 2019 10:20:08 +1200

Fix broken things

further oops

Signed-off-by:
microlith57 <microlith57@gmail.com>

Diffstat:

M404.html15+++++----------
1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/404.html b/404.html @@ -31,19 +31,14 @@ permalink: /404.html <body style='background:black; color:white'> <script> // Find current path (relative to grimgrains.com) - var parts = window.location.pathname.split('/') - var target = []; + var target = unescape(window.location.pathname); // Fancy slugify regex bit - parts.forEach(function(elem) { - elem = elem.toLowerCase(); - elem = elem.replace(/[\s·/_'",:;\.-]+/g, '+'); // Replace whitespace and "·/_'",:;.-" to "+" - elem = elem.replace(/^\++|\++$/g, ''); // Remove "+"es at start and end - target.push(elem); - }); - var target = parts.join('+'); // Rejoin path + target = target.toLowerCase(); + target = target.replace(/[\s·\\/_'",:;\.-]+/g, '+'); // Replace whitespace and "·\/_'",:;.-" to "+" + target = target.replace(/^\++|\++$/g, ''); // Remove "+"es at start and end - document.location.href = document.location.origin + "/#"+ target // Go to grimgrains.com/#target + document.location.href = document.location.origin + "/#" + target; // Go to grimgrains.com/#target </script> <h1 class="fadein">