#!/bin/bash
set -e
cd /app/src/blog
export LOCATION=/app/src/static/markdown/blog.html
echo '
' >> $LOCATION
for file in $(ls -t)
do
title=$(head -n1 $file)
line=$(moon /app/src/init/summary.moon $file)
linkname=$(echo $file | awk -F "." '{print $1}')
[[ -z "$line" ]] && false
echo '
'"$title"'
'"$line"'
Read More' >> $LOCATION
done
echo '
' >> $LOCATION