[gen.sh] add "last updated" section at the bottom of every page
This commit is contained in:
parent
17d6a8639c
commit
ef7f7e215f
17
gen.sh
17
gen.sh
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue