2015-02-13 20:42:42 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
2015-02-14 17:11:33 +00:00
|
|
|
|
2015-02-13 20:42:42 +00:00
|
|
|
cd /app/src/blog
|
|
|
|
|
2015-02-16 04:19:56 +00:00
|
|
|
export LOCATION=/app/src/static/markdown/blog.html
|
|
|
|
|
|
|
|
echo '<div class="row">' >> $LOCATION
|
2015-02-13 20:42:42 +00:00
|
|
|
|
2015-02-14 07:47:06 +00:00
|
|
|
for file in $(ls -t)
|
2015-02-13 20:42:42 +00:00
|
|
|
do
|
|
|
|
title=$(head -n1 $file)
|
2015-02-16 04:19:56 +00:00
|
|
|
line=$(moon /app/src/init/summary.moon $file)
|
2015-02-13 20:42:42 +00:00
|
|
|
linkname=$(echo $file | awk -F "." '{print $1}')
|
|
|
|
|
2015-02-16 04:19:56 +00:00
|
|
|
[[ -z "$line" ]] && false
|
|
|
|
|
|
|
|
echo '<div class="col-md-12 post"><h2>'"$title"'</h2>'"$line"'<a href="/blog/'"$linkname"'">Read More</a></div>' >> $LOCATION
|
2015-02-13 20:42:42 +00:00
|
|
|
done
|
2015-02-16 04:19:56 +00:00
|
|
|
echo '</div>' >> $LOCATION
|