Add index builder

Signed-off-by: adrien <adrien@iglou.eu>
This commit is contained in:
adrien 2020-03-25 19:03:06 +01:00
parent b554970fdb
commit cd158225db

16
build_index.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
files=""
in_f="${in_f:=nul}"
out_f="${out_f:=nul}"
out_p="${out_p:=nul}"
for file in "$out_f/$out_p"*; do
if [[ $file == *".html" ]]; then
files+="<li><a href=\"${file##*/}\">${file##*/}</a></li>"
fi
done
out="$(cat "$in_f/index.html")"
echo "${out//'[=index]'/${files}}" > "$out_f/index.html"