Add toc generation script
This commit is contained in:
parent
bbc5cf49f7
commit
c4ea910ffc
3 changed files with 26 additions and 1 deletions
2
page.sh
2
page.sh
|
@ -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
25
toc.sh
Executable 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"
|
Loading…
Reference in a new issue