This commit is contained in:
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#!/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 '<li>'
|
||||
echo '<a href="'"${article/.org/}.html"'">'"<date>$DATE</date> - $TITLE"'</a>'
|
||||
echo '<p>'
|
||||
awk '/^\*\*+/ { found_header = 0; found_first_header = 1 } /.+/ { if (found_header) { print } } /^\* / { if (!found_first_header) { found_header = 1 } }' < "$article"
|
||||
echo '</p>'
|
||||
echo '</li>'
|
||||
done)"
|
||||
|
||||
if [ -f index.html.in ]; then
|
||||
FILE=index.html.in
|
||||
else
|
||||
FILE=index.html
|
||||
fi
|
||||
|
||||
awk '/LINK_INSERT/ { at_stop = 1 } { if (!at_stop) { print } }' < $FILE
|
||||
echo "$LINKS"
|
||||
awk '{ if (at_start) { print } } /LINK_INSERT/ { at_start = 1 }' < $FILE
|
||||
Reference in New Issue
Block a user