change approach, too much m4
This commit is contained in:
23
build.sh
Executable file
23
build.sh
Executable file
@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
POSTS=`find ./posts -mindepth 1 -type d | sort -r`
|
||||
INDEX_TOC=`pwd`/toc.inc
|
||||
|
||||
|
||||
rm -f $INDEX_TOC
|
||||
for I in $POSTS; do
|
||||
(
|
||||
echo $I;
|
||||
cd $I;
|
||||
TITLE=`cat article.html | grep '<title>' | sed 's!^[[:space:]]*<title>\(.*\)</title>!\1!'`
|
||||
DATE=`cat article.html | grep '<meta name="date"' | sed 's!^[[:space:]]*<meta name="date" content="\(.*\)"/>!\1!'`
|
||||
PATH=`echo $I | sed 's!^\./!!'`
|
||||
echo "<li><a href=\"$PATH/article.html\">$DATE - $TITLE</a></li>" >> $INDEX_TOC
|
||||
)
|
||||
done
|
||||
|
||||
cat index.header toc.inc index.footer > index.html
|
||||
|
||||
|
||||
rsync -av --delete --exclude-from excludes.lst . /var/www/html
|
||||
|
Reference in New Issue
Block a user