#!/bin/sh rm -r dest || true mkdir dest # This is useful when deploying on netlify. Thanks to storing compiled binaries # in this folder they will be cached and restored. export PATH="$PWD/.jekyll-cache:$PATH" ./tools/compile post_link() { path=$1 title=$2 photo=$3 description=$4 cat << EOF

$title

$description

EOF } cat > wpisy/kronika.html << EOF

Ostatnie wpisy

RSS
EOF i=0 for f in `find wpisy/kronika/20* -name '*.md' | sort -r`; do path=`echo $f | sed 's/wpisy//;s/.md//'` title=`grep "^# " $f | head -n 1 | cut -c 2-` photo=`grep "!\[.*\]\(.*\)" $f | head -n 1 | cut -d "(" -f2 | cut -d ")" -f1` [ -z $photo ] && photo="/assets/default_tree.jpg" description=`grep -E "^[A-Z]" $f | grep -v "|" | head -n 1 | cut -d" " -f1-30` post_link "$path" "$title" "$photo" "$description" >> wpisy/kronika.html [ $i -lt 4 ] && \ # post_link "$path" "$title" "$photo" "$description" >> wpisy/index.md && \ i=$(($i+1)) done echo "
" >> wpisy/kronika.html ./ssg5 wpisy dest "19 PDH Puszcza" "https://19.niedzwiedzinski.cyou" cp -r static/* dest