summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2025-04-04 17:32:46 -0300
committerEuAndreh <eu@euandre.org>2025-04-04 17:32:52 -0300
commitc5ea69dbca1736a665f80aca45d92d20c8ff1d43 (patch)
treed547e64adbdf37c2ff587b760afb45dfd4c7fe51
parentsrc/{conf,html}: Make $publickey optional (diff)
downloadmkwb-c5ea69dbca1736a665f80aca45d92d20c8ff1d43.tar.gz
mkwb-c5ea69dbca1736a665f80aca45d92d20c8ff1d43.tar.xz
src/conf: Fix `base_url()` for top-level files
The documented `src/file.txt -> .` case in the comment 2 lines above.
-rwxr-xr-xsrc/conf1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/conf b/src/conf
index 453f755..5d879fd 100755
--- a/src/conf
+++ b/src/conf
@@ -110,6 +110,7 @@ base_url() {
# src/sub/dirs/file.txt -> ../..
# src/file.txt -> .
printf '%s/\n' "$(dirname -- "$UNPREFIXED")" |
+ sed 's|^\./$|.|' |
sed \
-e 's|[^/]*/|../|g' \
-e 's|/$||'