Add toc generation script

This commit is contained in:
Konstantin Nazarov 2021-08-08 18:47:34 +01:00
parent bbc5cf49f7
commit c4ea910ffc
Signed by: knazarov
GPG key ID: 4CFE0A42FA409C22
3 changed files with 26 additions and 1 deletions

View file

@ -6,7 +6,7 @@ expand() {
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="knazarovcom.css">
<link rel="stylesheet" type="text/css" href="style.css">
<title>
EOF

25
toc.sh Executable file
View file

@ -0,0 +1,25 @@
#!/bin/bash
render() {
TITLE="$1"
DIR="$2"
find "$DIR/" -type f -name '*.md' | while read -r FN
do
echo "FILE: $(realpath $FN)"
done
}
if [ -z "$1" ]; then
echo "Missing page title"
exit 1
fi
if [ ! -d "$2" ]; then
echo "Missing source directory"
exit 1
fi
render "$1" "$2"