fix the index generation

This commit is contained in:
Christine Dodrill 2015-02-14 09:11:33 -08:00
parent 7e06ce4057
commit 286cd850e8
1 changed files with 5 additions and 2 deletions

View File

@ -2,6 +2,9 @@
set -e
cd /tmp
wget http://www.frykholm.se/files/markdown.lua
cd /app/src/blog
IFS='
@ -10,9 +13,9 @@ IFS='
for file in $(ls -t)
do
title=$(head -n1 $file)
line=$(head -n4 $file | tail -n1)
line=$(head -n4 $file | tail -n1 | lua /tmp/markdown.lua -n)
linkname=$(echo $file | awk -F "." '{print $1}')
echo '<div class="post"><h2>'"$title"'</h2><p>'"$line"'...</p><a href="/blog/'"$linkname"'">Read More</a></div>' >> /app/src/static/markdown/blog.html
echo '<div class="post"><h2>'"$title"'</h2>'"$line"'<a href="/blog/'"$linkname"'">Read More</a></div>' >> /app/src/static/markdown/blog.html
echo "generated info for $file"
done