added new_entry.sh script and template

new file:   content/2015-11-15-migrating-from-wordpress-to-pelican.rst
	new file:   new_entry.sh
	new file:   template_new_entry.rst
This commit is contained in:
Russell Ballestrini 2015-11-15 16:03:21 -05:00
parent 6353ffd34b
commit b722e82637
3 changed files with 96 additions and 0 deletions

22
new_entry.sh Normal file
View file

@ -0,0 +1,22 @@
#!/bin/bash
if [ "$1" = "" ]
then
echo "you need to pass a slug"
exit
fi
THESLUG=$1
THEDATE1=`date +%Y-%m-%d`
THEDATE2=`date +"%Y-%m-%d %H:%M"`
THEFILE="content/$THEDATE1-$THESLUG.rst"
# if the entry does not exist, make a copy from template
if [ ! -f $THEFILE ];
then
cp "template_new_entry.rst" "$THEFILE"
sed -i "s/THEDATE/$THEDATE2/g" "$THEFILE"
sed -i "s/THESLUG/$THESLUG/g" "$THEFILE"
fi
vim "$THEFILE"