[loop-cycle-152] feat: scaffold the Wizard's Tower — two rooms, entry hall (#215) (#1)

This commit was merged in pull request #1.
This commit is contained in:
2026-03-18 21:33:17 -04:00
parent aada6098e2
commit 156e8df22a
12 changed files with 483 additions and 2 deletions

49
scripts/aw-post Executable file
View File

@@ -0,0 +1,49 @@
#!/usr/bin/env bash
# aw-post — Quick-post a scroll from the command line
#
# Usage:
# aw-post "Title of the Post"
# aw-post "Title" < body.md
# echo "Post body here" | aw-post "Title"
#
# Creates a new markdown file in blog/posts/ with frontmatter.
# Rebuilds the blog index and RSS feed.
set -euo pipefail
BLOG_DIR="$(cd "$(dirname "$0")/.." && pwd)/blog/posts"
if [ $# -lt 1 ]; then
echo "Usage: aw-post \"Title of the Post\""
echo " Pipe or redirect body content via stdin."
exit 1
fi
TITLE="$1"
DATE=$(date +%Y-%m-%d)
SLUG=$(echo "$TITLE" | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | tr -cd 'a-z0-9-')
FILENAME="${DATE}-${SLUG}.md"
FILEPATH="${BLOG_DIR}/${FILENAME}"
if [ -f "$FILEPATH" ]; then
echo "Error: $FILEPATH already exists"
exit 1
fi
# Read body from stdin if available
BODY=""
if [ ! -t 0 ]; then
BODY=$(cat)
fi
cat > "$FILEPATH" << EOF
---
title: "${TITLE}"
date: ${DATE}
---
${BODY}
EOF
echo "Created: ${FILEPATH}"
echo "Next: rebuild with 'make build'"