[NEW] scripts: They make the Makefile go

This commit is contained in:
Andrew Rogers 2023-10-20 05:10:22 -05:00
commit f6b1f4c14a
3 changed files with 33 additions and 0 deletions

23
scripts/blogposts.bash Executable file
View file

@ -0,0 +1,23 @@
#!/usr/bin/env bash
cat <<HDR
<div class="inner">
<h1>Posts</h1>
<dl> <!-- no longer me -->
HDR
for blog_post_md in blog/*.md; do
date=$(grep -o '[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}' <<<"$blog_post_md")
title=$(grep -m 1 '^#\s\+' "$blog_post_md" | sed 's/^#\s\+//')
html=$(sed 's/\.md$/.html/' <<<"$blog_post_md")
cat <<INNIE
<dt>$date</dt>
<dd><a href="$html">$title</a></dd>
INNIE
done
cat <<FTR # Short for Fetterman
</dl> <!-- no longer on the dl -->
</div>
FTR