This commit is contained in:
2026-03-25 15:14:49 +09:00
commit 266e0b0cf9
84 changed files with 4624 additions and 0 deletions

21
scripts/new.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/bin/bash
TITLE="changeme"
DATE=$(date +%Y-%m-%d)
FILE="$DATE-$TITLE.md"
if [ ! -f content/posts/$FILE ]; then
echo Creating new file $FILE
cp content/posts/2000-01-01-draft.md content/posts/$FILE
sed -i "s/date = 2000-01-01T00:00:00Z/date = $(date -Isec)/g" content/posts/$FILE
fi
if [ $( command -v subl ) ]; then
subl $FILE
elif [ $( command -v gedit ) ]; then
gedit $FILE
elif [ $( command -v vim ) ]; then
vim $FILE
else
$EDITOR $FILE
fi