summaryrefslogtreecommitdiff
path: root/scripts/addback.sh
blob: 481733f074fd2654b81bea3a277dfea32a1dca83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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