From b0e06544a5299b3e77561f61544ff6a23094e3b1 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sun, 5 Aug 2018 02:28:01 +0200 Subject: [PATCH] nieuws: create new articles relative to page root Support different categories, assuming link is run from index. --- nieuws/edit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nieuws/edit.js b/nieuws/edit.js index 3155ac0..6f3f54f 100644 --- a/nieuws/edit.js +++ b/nieuws/edit.js @@ -8,7 +8,7 @@ editlink.onclick = function () { var url = today[0] + '/' + today[1] + '-' + today[2] + '-' + input.toLowerCase().replace(/[^a-z0-9]+/g, '-').trim(); var title = encodeURIComponent(input.trim()); - window.location = '/nieuws/'+url+'?edit='+title+'#edit'; + window.location = window.location.pathname+'/'+url+'?edit='+title+'#edit'; return false; }; document.getElementById('news').appendChild(editlink); -- 2.30.0