Merge remote branch 'revans/master'
commit
3d52ee0be4
|
|
@ -16,8 +16,8 @@ fi
|
||||||
alias c='clear'
|
alias c='clear'
|
||||||
alias k='clear'
|
alias k='clear'
|
||||||
|
|
||||||
alias editor="$EDITOR"
|
alias edit="$EDITOR"
|
||||||
alias pager="$PAGER"
|
alias page="$PAGER"
|
||||||
|
|
||||||
alias q="exit"
|
alias q="exit"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,20 @@
|
||||||
# Open the root of your site in your favorite editor
|
# Open the root of your site in your vim or cd to it
|
||||||
|
|
||||||
|
if [ $EDITOR = "vim" ]
|
||||||
|
then
|
||||||
alias newentry="cd $JEKYLL_LOCAL_ROOT && $EDITOR ."
|
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)
|
# 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
|
# Build and locally serve the site
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,56 @@
|
||||||
|
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")
|
||||||
|
|
||||||
|
# Get the title for the new post
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
@ -28,12 +28,17 @@ unset MAILCHECK
|
||||||
|
|
||||||
# Change this to the path of your local jekyll root to use the jekyll aliases
|
# 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="$HOME/Sites/jekyllsite"
|
||||||
|
|
||||||
# And change this to the remote server and root
|
# And change this to the remote server and root
|
||||||
|
|
||||||
export JEKYLL_REMOTE_ROOT="user@server:/path/to/jekyll/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.
|
# Change this to your console based IRC client of choice.
|
||||||
|
|
||||||
export IRC_CLIENT='irssi'
|
export IRC_CLIENT='irssi'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue