mirror of
https://github.com/welpo/tabi.git
synced 2026-03-16 04:57:20 +01:00
Merge 742d9ea1fc into 3896c1597c
This commit is contained in:
commit
fc7bd13540
15 changed files with 180 additions and 2 deletions
29
scripts/new-micro.sh
Executable file
29
scripts/new-micro.sh
Executable 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"
|
||||
Loading…
Add table
Add a link
Reference in a new issue