[gen.sh] add backlinks [reading] finish voluspá

This commit is contained in:
opfez 2022-03-21 20:02:31 +01:00
parent c155656270
commit 18d3e57da7
2 changed files with 17 additions and 0 deletions

13
gen.sh
View File

@ -26,6 +26,7 @@ for file in site-src/*; do
cp $file $tmp
fi
# last changed section
if git log | grep "\w*\[$bn\]" > /dev/null; then
git log --grep="\[$bn\]" --format="%as:%s" \
| sed "s/\[.*\]//g" \
@ -33,6 +34,18 @@ for file in site-src/*; do
| sed "s/$/\n/g" >> $tmp
fi
# backlinks
incoming=$(grep -i "{$bn}\|{$bn " site-src/* \
| sed "s/\..*$//g" \
| sed "s/^.*\///g" \
| sed "s/^/{/g" \
| sed "s/$/}/g" \
| tr '\n' ' ' \
| sed "s/$/\n\n/g")
if [ ! -z "$incoming" ]; then
printf "\n_Incoming:_ $incoming\n" >> $tmp
fi
./format $tmp site/$bn.html
rm $tmp
done

View File

@ -6,6 +6,10 @@ _SICP_
Following is a list of various texts I've read.
** 2022
_Vǫluspá_
** 2021
_The Three-Body Problem_, 刘慈欣 (Cixin Liu)