diff options
Diffstat (limited to 'scripts/addback.sh')
-rwxr-xr-x | scripts/addback.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/addback.sh b/scripts/addback.sh new file mode 100755 index 0000000..481733f --- /dev/null +++ b/scripts/addback.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# A simple extension to add a back button to every page that needs one. + +PROJECT_ROOT="./build/website" +if [ "$(realpath "$1")" = "$(realpath "$PROJECT_ROOT/index.html")" ]; then + printf ' ' + exit 0 +fi + +# +if [ "$(basename "$1")" = 'index.html' ]; +then + printf '<a href="\.\./index\.html">Back</a>' +else + printf '<a href="\./index\.html">Back</a>' +fi |