#!/usr/bin/env bash LINKS="$(ls articles/*.org | tac | head -n 10 | while read -r article; do TITLE="$(grep -E '^#\+TITLE:' "$article" | sed -e 's/^#+TITLE:\s*//')" DATE="$(git show --no-patch --no-notes --pretty='%as' `git rev-list -1 HEAD -- $article`)" echo '
' awk '/^\*\*+/ { found_header = 0; found_first_header = 1 } /.+/ { if (found_header) { print } } /^\* / { if (!found_first_header) { found_header = 1 } }' < "$article" echo '
' echo '