From 577aea4a9e545cb7e1967670c73bfaaed9cead2a Mon Sep 17 00:00:00 2001 From: Kohei Yoshino Date: Thu, 21 Nov 2024 22:42:53 -0500 Subject: [PATCH] Allow `.` for `media_folder` --- src/lib/services/config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/services/config.js b/src/lib/services/config.js index 93ab645b..74697574 100644 --- a/src/lib/services/config.js +++ b/src/lib/services/config.js @@ -225,7 +225,8 @@ siteConfig.subscribe((config) => { .sort((a, b) => compare(Object.values(a.filePathMap)[0], Object.values(b.filePathMap)[0])), ]; - const globalMediaFolder = stripSlashes(_globalMediaFolder); + // Normalize the media folder: an empty string, `/` and `.` are all considered as the root folder + const globalMediaFolder = stripSlashes(_globalMediaFolder).replace(/^\.$/, ''); // Some frameworks expect asset paths starting with `@`, like `@assets/images/...`. Remove an // extra leading slash in that case. A trailing slash should always be removed internally.