From afbda09a5f80ed5b769b50a089bee753e279bdca Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Mon, 1 Nov 2010 17:03:10 -0500 Subject: [PATCH 1/9] Changed names of pager and editor aliases to page and edit, respectively. --- aliases/general.aliases.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aliases/general.aliases.bash b/aliases/general.aliases.bash index 201a4197..1cb470f1 100644 --- a/aliases/general.aliases.bash +++ b/aliases/general.aliases.bash @@ -16,8 +16,8 @@ fi alias c='clear' alias k='clear' -alias editor="$EDITOR" -alias pager="$PAGER" +alias edit="$EDITOR" +alias page="$PAGER" alias q="exit" From 0097a1e3a835583ca5435326811fe6519d5fd102 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Mon, 1 Nov 2010 20:04:28 -0500 Subject: [PATCH 2/9] Added check to see if user is using vim with newentry alias. --- aliases/jekyll.aliases.bash | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/aliases/jekyll.aliases.bash b/aliases/jekyll.aliases.bash index a3e3fc05..a9fed047 100644 --- a/aliases/jekyll.aliases.bash +++ b/aliases/jekyll.aliases.bash @@ -1,6 +1,10 @@ -# Open the root of your site in your favorite editor +# Open the root of your site in your vim or cd to it -alias newentry="cd $JEKYLL_LOCAL_ROOT && $EDITOR ." +if [ $EDITOR = "vim"] +then + alias newentry="cd $JEKYLL_LOCAL_ROOT && $EDITOR ." +else + alias newentry="cd $JEKYLL_LOCAL_ROOT" # Open the _posts/ directory for making a new blog post (seperate from above alias because not everyone uses jekyll for a blog) From 689afd9b3d28ebe82625a4f191b506cb0dcf7c05 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Mon, 1 Nov 2010 20:05:33 -0500 Subject: [PATCH 3/9] Added check for vim in newpost too. --- aliases/jekyll.aliases.bash | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/aliases/jekyll.aliases.bash b/aliases/jekyll.aliases.bash index a9fed047..0e1e3e75 100644 --- a/aliases/jekyll.aliases.bash +++ b/aliases/jekyll.aliases.bash @@ -5,10 +5,16 @@ then alias newentry="cd $JEKYLL_LOCAL_ROOT && $EDITOR ." else alias newentry="cd $JEKYLL_LOCAL_ROOT" +fi # Open the _posts/ directory for making a new blog post (seperate from above alias because not everyone uses jekyll for a blog) -alias newpost="cd $JEKYLL_LOCAL_ROOT/_posts && $EDITOR ." +if [ $EDITOR = "vim"] +then + alias newpost="cd $JEKYLL_LOCAL_ROOT/_posts && $EDITOR ." +else + alias newpost="cd $JEKYLL_LOCAL_ROOT" +fi # Build and locally serve the site From db5a47eb684510714a81466b9b556538c32dcdd1 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Mon, 1 Nov 2010 20:06:57 -0500 Subject: [PATCH 4/9] Syntax Fixes --- aliases/jekyll.aliases.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aliases/jekyll.aliases.bash b/aliases/jekyll.aliases.bash index 0e1e3e75..4e0d740e 100644 --- a/aliases/jekyll.aliases.bash +++ b/aliases/jekyll.aliases.bash @@ -1,6 +1,6 @@ # Open the root of your site in your vim or cd to it -if [ $EDITOR = "vim"] +if [ $EDITOR = "vim" ] then alias newentry="cd $JEKYLL_LOCAL_ROOT && $EDITOR ." else @@ -9,7 +9,7 @@ fi # Open the _posts/ directory for making a new blog post (seperate from above alias because not everyone uses jekyll for a blog) -if [ $EDITOR = "vim"] +if [ $EDITOR = "vim" ] then alias newpost="cd $JEKYLL_LOCAL_ROOT/_posts && $EDITOR ." else From a8fc3c78d9d137f4468d89c76b95412a66b0ed18 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Mon, 1 Nov 2010 20:24:39 -0500 Subject: [PATCH 5/9] Added jekyll.plugins.bash file --- plugins/jekyll.plugins.bash | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 plugins/jekyll.plugins.bash diff --git a/plugins/jekyll.plugins.bash b/plugins/jekyll.plugins.bash new file mode 100644 index 00000000..31fb9a3a --- /dev/null +++ b/plugins/jekyll.plugins.bash @@ -0,0 +1,12 @@ +newpost() { + + # Get the date for the new post's filename + + FNAME_DATE=$(date "+%Y-%m-%d") + + # Get the title for the new post + + read -p "Enter title of the new post: " POST_TITLE + + +} From 61fcd21162c5d914689d1efdaa10df16ee70a4f9 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Mon, 1 Nov 2010 20:24:53 -0500 Subject: [PATCH 6/9] Added the last jekyll variable we will need... hopefully. --- template/bash_profile.template.bash | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/template/bash_profile.template.bash b/template/bash_profile.template.bash index 46d0c4a4..31e6645b 100644 --- a/template/bash_profile.template.bash +++ b/template/bash_profile.template.bash @@ -28,12 +28,17 @@ unset MAILCHECK # Change this to the path of your local jekyll root to use the jekyll aliases -export JEKYLL_LOCAL_ROOT="~/Sites/mrminimalist" +export JEKYLL_LOCAL_ROOT="~/Sites/jekyllsite" # And change this to the remote server and root export JEKYLL_REMOTE_ROOT="user@server:/path/to/jekyll/root" +# And, for the last of the jekyll variables, this is the formatting you use, eg: markdown, +# textile, etc. Basically whatever you use as the extension for posts, without the preceding dot + +export JEKYLL_FORMATTING="markdown" + # Change this to your console based IRC client of choice. export IRC_CLIENT='irssi' From ea84e4b7a6ed84ad718ba43aeabf16e5264953f7 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Mon, 1 Nov 2010 20:49:07 -0500 Subject: [PATCH 7/9] Got rid of old "newpost" alias to make way for the "newpost" function. --- aliases/jekyll.aliases.bash | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/aliases/jekyll.aliases.bash b/aliases/jekyll.aliases.bash index 4e0d740e..c447894d 100644 --- a/aliases/jekyll.aliases.bash +++ b/aliases/jekyll.aliases.bash @@ -9,12 +9,12 @@ fi # Open the _posts/ directory for making a new blog post (seperate from above alias because not everyone uses jekyll for a blog) -if [ $EDITOR = "vim" ] -then - alias newpost="cd $JEKYLL_LOCAL_ROOT/_posts && $EDITOR ." -else - alias newpost="cd $JEKYLL_LOCAL_ROOT" -fi +# if [ $editor = "vim" ] +# then +# alias newpost="cd $jekyll_local_root/_posts && $editor ." +# else +# alias newpost="cd $jekyll_local_root" +# fi # Build and locally serve the site From 1a045dea98f647ade67463125991f021a559c7fd Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Mon, 1 Nov 2010 20:49:57 -0500 Subject: [PATCH 8/9] Added newpost plugin. Creates a new jekyll post with the current date, and a user specified title. Even fills in the YAML Front Matter. Sorry if that seemed like bragging, I just wanted everyone to notice so they could make use of it better... --- plugins/jekyll.plugins.bash | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/plugins/jekyll.plugins.bash b/plugins/jekyll.plugins.bash index 31fb9a3a..1933f074 100644 --- a/plugins/jekyll.plugins.bash +++ b/plugins/jekyll.plugins.bash @@ -1,5 +1,9 @@ newpost() { + # 'cd' into the local jekyll root + + cd "$JEKYLL_LOCAL_ROOT/_posts" + # Get the date for the new post's filename FNAME_DATE=$(date "+%Y-%m-%d") @@ -8,5 +12,45 @@ newpost() { read -p "Enter title of the new post: " POST_TITLE + # Convert the spaces in the title to hyphens for use in the filename + FNAME_POST_TITLE=`echo $POST_TITLE | tr ' ' "-"` + + # Now, put it all together for the full filename + + FNAME="$FNAME_DATE-$FNAME_POST_TITLE.$JEKYLL_FORMATTING" + + # And, finally, create the actual post file. But we're not done yet... + + touch "$FNAME" + + # Write a little stuff to the file for the YAML Front Matter + + echo "---" >> $FNAME + + # Now we have to get the date, again. But this time for in the header (YAML Front Matter) of + # the file + + YAML_DATE=$(date "+%B %d %X") + + # Echo the YAML Formatted date to the post file + + echo "date: $YAML_DATE" >> $FNAME + + # Echo the original post title to the YAML Front Matter header + + echo "title: $POST_TITLE" >> $FNAME + + # And, now, echo the "post" layout to the YAML Front Matter header + + echo "layout: post" >> $FNAME + + # Close the YAML Front Matter Header + + echo "---" >> $FNAME + echo >> $FNAME + + # Open the file in your favorite editor + + $EDITOR $FNAME } From 1dd1add7a7ac06c103a0c302c45bdabdc5becbb4 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Mon, 1 Nov 2010 20:57:35 -0500 Subject: [PATCH 9/9] Changed "~" to "$HOME" for JEKYLL_LOCAL_ROOT variable. Sometimes ~ works, sometimes not. I know for a fact that $HOME does though. --- template/bash_profile.template.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/bash_profile.template.bash b/template/bash_profile.template.bash index 31e6645b..a98e65c8 100644 --- a/template/bash_profile.template.bash +++ b/template/bash_profile.template.bash @@ -28,7 +28,7 @@ unset MAILCHECK # Change this to the path of your local jekyll root to use the jekyll aliases -export JEKYLL_LOCAL_ROOT="~/Sites/jekyllsite" +export JEKYLL_LOCAL_ROOT="$HOME/Sites/jekyllsite" # And change this to the remote server and root