From 397484c5b4d5ffe815ec80dec04e2e9ac45fbb1b Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Sat, 6 Apr 2024 22:49:10 +0000 Subject: [PATCH] fix: absolute path for b64 images on 404 page (#8) --- assets/js/modules/glitch/Generator.mjs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/assets/js/modules/glitch/Generator.mjs b/assets/js/modules/glitch/Generator.mjs index 07761b9..66dab30 100755 --- a/assets/js/modules/glitch/Generator.mjs +++ b/assets/js/modules/glitch/Generator.mjs @@ -17,12 +17,8 @@ class Generator { get dir () { return this._dir; }, set dir (newPath) { const url = new URL(newPath); - - // Replace pathname of this file with relative path to assets - const path = url.pathname.split("/"); - path[path.length - 1] = this._dir_rel; - - url.pathname = path.join("/"); + url.pathname = this._dir_rel; + this._dir = url.toString(); } }