[gen.sh] add "last updated" section at the bottom of every page

This commit is contained in:
opfez 2022-01-29 00:18:58 +01:00
parent 17d6a8639c
commit ef7f7e215f
1 changed files with 13 additions and 4 deletions

17
gen.sh
View File

@ -17,15 +17,24 @@ echo "Generating pages"
for file in site-src/*; do
bn=$(basename $file .wtn)
echo " $file -> site/$bn.html"
tmp=$(mktemp)
# if the file has macros, expand them
if grep "#makro" $file >/dev/null; then
tmp=$(mktemp)
$MAKROS $file > $tmp
./format $tmp site/$bn.html
rm $tmp
else
./format $file site/$bn.html
cp $file $tmp
fi
if git log | grep "\w*\[$bn\]" > /dev/null; then
echo "\n\nLatest changes to this page:\n\n" >> $tmp
echo '``' >> $tmp
git log --grep="\[$bn\]" --format="%as:%s" | sed "s/\[.*\]//g" >> $tmp
echo '``' >> $tmp
fi
./format $tmp site/$bn.html
rm $tmp
done
# Generate the site index