This commit is contained in:
Lee Kai Ze 2026-02-27 21:29:09 -08:00 committed by GitHub
commit fc7bd13540
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 180 additions and 2 deletions

29
scripts/new-micro.sh Executable file
View file

@ -0,0 +1,29 @@
#!/usr/bin/env bash
# Quick micro post generator - eliminates title/date friction
set -euo pipefail
# Get current timestamp
NOW=$(date +"%Y-%m-%dT%H:%M:%S%:z")
FILENAME=$(date +"%Y-%m-%d-%H%M")
TITLE=$(date +"%Y-%m-%d %H:%M")
# Get content from stdin or prompt
if [ -t 0 ]; then
echo "Enter micro post content (Ctrl+D when done):"
CONTENT=$(cat)
else
CONTENT=$(cat)
fi
# Create post
cat > "content/micro/${FILENAME}.md" <<EOF
+++
title = "${TITLE}"
date = ${NOW}
+++
${CONTENT}
EOF
echo "Created: content/micro/${FILENAME}.md"