3 # pinosaur's blog script
5 blog_index_file="blogindex.html"
6 rolling_file="rolling.html"
7 template_file="template.html"
11 [ ! -z "$EDITOR" ] && EDITOR="vim"
20 # add a confirmation of sorts here
24 [ -z $1 ] && echo "please supply a name" && exit 1
26 # do some sed stuff here
27 cp $template_file "$data_dir/drafts/$1"
32 echo "Select which post to publish"
33 ls -1 "$data_dir/drafts" | nl
37 echo "Select which post to delete"
38 ls -1 "$data_dir/published" | nl
41 # check to see if all required files are present
42 [ ! -f $blog_index_file ] && echo "missing $blog_index_file" && exit 1
43 [ ! -f $rolling_file ] && echo "missing $rolling_file" && exit 1
44 [ ! -f $template_file ] && echo "missing $template_file" && exit 1
45 [ ! -f $rss_file ] && echo "missing $rss_file" && exit 1
47 # possibly also check to see if index and rolling have the proper headers
50 # check if blog dir exists
51 [ ! -d $data_dir ] && echo "initing blog" &&\
52 mkdir -p "$data_dir/drafts" &&\
53 mkdir -p "$data_dir/published" &&\
54 touch "$data_dir/database"
60 d|delete) echo "delete";;
61 D|purge) echo "purge";;
62 *) echo "helper" && exit 1;;