aboutsummaryrefslogtreecommitdiff
path: root/preprocessor/url.sh
diff options
context:
space:
mode:
Diffstat (limited to 'preprocessor/url.sh')
-rwxr-xr-xpreprocessor/url.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/preprocessor/url.sh b/preprocessor/url.sh
index bc4e221..1c04b90 100755
--- a/preprocessor/url.sh
+++ b/preprocessor/url.sh
@@ -1,4 +1,12 @@
#!/bin/bash
-read_from_pipe() { read "$@" <&0; }
+url=$1
-echo "$(read_from_pipe | head -1)"
+if [[ "$url" =~ .*"..".* ]]; then
+ url="/"
+fi
+
+if [ -f "./public/$url/index.bhtml" ]; then
+ url="/$url/index.bhtml"
+fi
+
+echo $url