#!/usr/bin/bash
ME=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )

# this is deprecated, use scripts/render_site.sh instead
if [ ! -f ./scripts/gen.sh ]; then
    echo "you should call this from doc root"
    exit -1
fi

m4 <${ME}/templates/list.tl \
    -D _TL_LISTING="$(tree -H 'https://wth.moe/' -I "index.html"   | sed -n '/<\/h1>/,/<hr>/p' | sed '1d;$d' )" \
    -D _TL_CURDIR="" \
    >index.html
