summaryrefslogtreecommitdiff
path: root/scripts/addback.sh
blob: 28248b92eedb023f6dda909ca57169d438e8ed94 (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