[last-changed] "hours/minutes/seconds ago" -> "today"

This commit is contained in:
opfez 2021-10-23 17:39:01 +02:00
parent f3d75597a5
commit a512a21c96
1 changed files with 6 additions and 0 deletions

6
gen.sh
View File

@ -53,6 +53,12 @@ done | sort -r > $sorted
while read line; do
file=$(echo $line | awk '{print $2}')
relative=$(git log -n 1 --pretty=format:%cr $file)
# instead of showing "x hours/minutes/seconds ago", show "today"
if echo $relative | grep "hour" >/dev/null \
|| echo $relative | grep "minute" >/dev/null \
|| echo $relative | grep "second" >/dev/null; then
relative="today"
fi
bn=$(basename $file .wtn)
echo "<p><a href=\"$bn.html\">$bn</a> - $relative"
done < $sorted >> $lastchanged