Merge pull request #1969 from gaelicWizard/plugin-jekyll
Plugin/jekyll: lint and stuffpull/2006/head^2
commit
f534505357
|
|
@ -137,13 +137,6 @@ elif [ -s /Applications/Preview.app ]; then
|
||||||
PREVIEW="/Applications/Preview.app"
|
PREVIEW="/Applications/Preview.app"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Load all the Jekyll stuff
|
|
||||||
|
|
||||||
if [ -e "$HOME/.jekyllconfig" ]; then
|
|
||||||
# shellcheck disable=SC1090
|
|
||||||
. "$HOME/.jekyllconfig"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# BASH_IT_RELOAD_LEGACY is set.
|
# BASH_IT_RELOAD_LEGACY is set.
|
||||||
if ! _command_exists reload && [[ -n "${BASH_IT_RELOAD_LEGACY:-}" ]]; then
|
if ! _command_exists reload && [[ -n "${BASH_IT_RELOAD_LEGACY:-}" ]]; then
|
||||||
case $OSTYPE in
|
case $OSTYPE in
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,7 @@ plugins/available/history-search.plugin.bash
|
||||||
plugins/available/history-substring-search.plugin.bash
|
plugins/available/history-substring-search.plugin.bash
|
||||||
plugins/available/history.plugin.bash
|
plugins/available/history.plugin.bash
|
||||||
plugins/available/hub.plugin.bash
|
plugins/available/hub.plugin.bash
|
||||||
|
plugins/available/jekyll.plugin.bash
|
||||||
plugins/available/jump.plugin.bash
|
plugins/available/jump.plugin.bash
|
||||||
plugins/available/less-pretty-cat.plugin.bash
|
plugins/available/less-pretty-cat.plugin.bash
|
||||||
plugins/available/node.plugin.bash
|
plugins/available/node.plugin.bash
|
||||||
|
|
|
||||||
|
|
@ -1,367 +1,288 @@
|
||||||
|
# shellcheck shell=bash
|
||||||
cite about-plugin
|
cite about-plugin
|
||||||
about-plugin 'manage your jekyll site'
|
about-plugin 'manage your jekyll site'
|
||||||
|
|
||||||
editpost() {
|
function editpost() {
|
||||||
about 'edit a post'
|
about 'edit a post'
|
||||||
param '1: site directory'
|
param '1: site directory'
|
||||||
group 'jekyll'
|
group 'jekyll'
|
||||||
|
|
||||||
unset SITE
|
local SITE site POST DATE TITLE POSTS
|
||||||
if [ -z "$1" ]
|
local -i COUNTER=1 POST_TO_EDIT ret
|
||||||
then
|
if [[ -z "${1:-}" ]]; then
|
||||||
echo "Error: no site specified."
|
echo "Error: no site specified."
|
||||||
echo "The site is the name of the directory your project is in."
|
echo "The site is the name of the directory your project is in."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for site in ${SITES[@]}
|
for site in "${SITES[@]:-}"; do
|
||||||
do
|
if [[ "${site##*/}" == "$1" ]]; then
|
||||||
if [ "${site##*/}" = "$1" ]
|
SITE="${site}"
|
||||||
then
|
break
|
||||||
SITE=$site
|
fi
|
||||||
break
|
done
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ -z "$SITE" ]
|
if [[ -z "${SITE:-}" ]]; then
|
||||||
then
|
echo "No such site."
|
||||||
echo "No such site."
|
return 1
|
||||||
return 1
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
builtin cd "$SITE/_posts"
|
pushd "${SITE}/_posts" > /dev/null || return
|
||||||
|
|
||||||
COUNTER=1
|
for POST in *; do
|
||||||
NUMBER="$RANDOM"
|
DATE="$(echo "${POST}" | grep -oE "[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}")"
|
||||||
TMPFILE="/tmp/editpost-$NUMBER"
|
TITLE="$(grep -oE "title: (.+)" < "${POST}")"
|
||||||
|
TITLE="${TITLE/title: /}"
|
||||||
for POST in *
|
echo "${COUNTER}) ${DATE} ${TITLE}"
|
||||||
do
|
POSTS[COUNTER]="$POST"
|
||||||
DATE=`echo $POST | grep -oE "[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}"`
|
COUNTER="$((COUNTER + 1))"
|
||||||
TITLE=`cat $POST | grep -oE "title: (.+)"`
|
done > >(less)
|
||||||
TITLE=`echo $TITLE | sed 's/title: //'`
|
read -rp "Number of post to edit: " POST_TO_EDIT
|
||||||
echo "$COUNTER) $DATE $TITLE" >> "$TMPFILE"
|
"${JEKYLL_EDITOR:-${VISUAL:-${EDITOR:-${ALTERNATE_EDITOR:-nano}}}}" "${POSTS[POST_TO_EDIT]}"
|
||||||
POSTS[$COUNTER]=$POST
|
ret="$?"
|
||||||
COUNTER=`expr $COUNTER + 1`
|
popd > /dev/null || return "$ret"
|
||||||
done
|
return "$ret"
|
||||||
less $TMPFILE
|
|
||||||
read -p "Number of post to edit: " POST_TO_EDIT
|
|
||||||
if [ -z "$JEKYLL_EDITOR" ]
|
|
||||||
then
|
|
||||||
nano "${POSTS[$POST_TO_EDIT]}"
|
|
||||||
else
|
|
||||||
"$JEKYLL_EDITOR" "${POSTS[$POST_TO_EDIT]}"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
newpost() {
|
function newpost() {
|
||||||
about 'create a new post'
|
about 'create a new post'
|
||||||
param '1: site directory'
|
param '1: site directory'
|
||||||
group 'jekyll'
|
group 'jekyll'
|
||||||
|
|
||||||
unset SITE
|
local SITE site FNAME_POST_TITLE FNAME YAML_DATE
|
||||||
if [ -z "$1" ]
|
local JEKYLL_FORMATTING FNAME_DATE OPTIONS OPTION POST_TYPE POST_TITLE
|
||||||
then
|
local -i loc=0 ret
|
||||||
echo "Error: no site specified."
|
if [[ -z "${1:-}" ]]; then
|
||||||
echo "The site is the name of the directory your project is in."
|
echo "Error: no site specified."
|
||||||
return 1
|
echo "The site is the name of the directory your project is in."
|
||||||
fi
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "$SITE" ]
|
if [[ -z "${SITE}" ]]; then
|
||||||
then
|
echo "No such site."
|
||||||
echo "No such site."
|
return 1
|
||||||
return 1
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
loc=0
|
for site in "${SITES[@]}"; do
|
||||||
|
if [[ "${site##*/}" == "$1" ]]; then
|
||||||
|
SITE="$site"
|
||||||
|
JEKYLL_FORMATTING="${MARKUPS[loc]}"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
loc=$((loc + 1))
|
||||||
|
done
|
||||||
|
|
||||||
for site in ${SITES[@]}
|
# Change directory into the local jekyll root
|
||||||
do
|
pushd "${SITE}/_posts" > /dev/null || return
|
||||||
if [ "${site##*/}" = "$1" ]
|
|
||||||
then
|
|
||||||
SITE=$site
|
|
||||||
JEKYLL_FORMATTING=${MARKUPS[$loc]}
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
loc=$(($loc+1))
|
|
||||||
done
|
|
||||||
|
|
||||||
# 'builtin cd' into the local jekyll root
|
# Get the date for the new post's filename
|
||||||
|
FNAME_DATE="$(date "+%Y-%m-%d")"
|
||||||
|
|
||||||
builtin cd "$SITE/_posts"
|
# If the user is using markdown or textile formatting, let them choose what type of post they want. Sort of like Tumblr.
|
||||||
|
OPTIONS=('Text' 'Quote' 'Image' 'Audio' 'Video' 'Link')
|
||||||
|
|
||||||
# Get the date for the new post's filename
|
if [[ $JEKYLL_FORMATTING == "markdown" || $JEKYLL_FORMATTING == "textile" ]]; then
|
||||||
|
select OPTION in "${OPTIONS[@]}"; do
|
||||||
|
POST_TYPE="${OPTION}"
|
||||||
|
break
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
FNAME_DATE=$(date "+%Y-%m-%d")
|
# Get the title for the new post
|
||||||
|
read -rp "Enter title of the new post: " POST_TITLE
|
||||||
|
|
||||||
# If the user is using markdown or textile formatting, let them choose what type of post they want. Sort of like Tumblr.
|
# Convert the spaces in the title to hyphens for use in the filename
|
||||||
|
FNAME_POST_TITLE="${POST_TITLE/ /-}"
|
||||||
|
|
||||||
OPTIONS="Text Quote Image Audio Video Link"
|
# Now, put it all together for the full filename
|
||||||
|
FNAME="$FNAME_DATE-$FNAME_POST_TITLE.$JEKYLL_FORMATTING"
|
||||||
|
|
||||||
if [ $JEKYLL_FORMATTING = "markdown" -o $JEKYLL_FORMATTING = "textile" ]
|
# And, finally, create the actual post file. But we're not done yet...
|
||||||
then
|
{
|
||||||
select OPTION in $OPTIONS
|
# Write a little stuff to the file for the YAML Front Matter
|
||||||
do
|
echo "---"
|
||||||
if [[ $OPTION = "Text" ]]
|
|
||||||
then
|
|
||||||
POST_TYPE="Text"
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $OPTION = "Quote" ]]
|
# Now we have to get the date, again. But this time for in the header (YAML Front Matter) of the file
|
||||||
then
|
YAML_DATE="$(date "+%B %d %Y %X")"
|
||||||
POST_TYPE="Quote"
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $OPTION = "Image" ]]
|
# Echo the YAML Formatted date to the post file
|
||||||
then
|
echo "date: $YAML_DATE"
|
||||||
POST_TYPE="Image"
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $OPTION = "Audio" ]]
|
# Echo the original post title to the YAML Front Matter header
|
||||||
then
|
echo "title: $POST_TITLE"
|
||||||
POST_TYPE="Audio"
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $OPTION = "Video" ]]
|
# And, now, echo the "post" layout to the YAML Front Matter header
|
||||||
then
|
echo "layout: post"
|
||||||
POST_TYPE="Video"
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $OPTION = "Link" ]]
|
# Close the YAML Front Matter Header
|
||||||
then
|
echo "---"
|
||||||
POST_TYPE="Link"
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Get the title for the new post
|
echo
|
||||||
|
} > "${FNAME}"
|
||||||
|
|
||||||
read -p "Enter title of the new post: " POST_TITLE
|
# Generate template text based on the post type
|
||||||
|
if [[ $JEKYLL_FORMATTING == "markdown" ]]; then
|
||||||
|
case $POST_TYPE in
|
||||||
|
"Text")
|
||||||
|
true
|
||||||
|
;;
|
||||||
|
"Quote")
|
||||||
|
echo "> Quote"
|
||||||
|
echo
|
||||||
|
echo "— Author"
|
||||||
|
;;
|
||||||
|
"Image")
|
||||||
|
echo ""
|
||||||
|
;;
|
||||||
|
"Audio")
|
||||||
|
echo "<html><audio src=\"/path/to/audio/file\" controls=\"controls\"></audio></html>"
|
||||||
|
;;
|
||||||
|
"Video")
|
||||||
|
echo "<html><video src=\"/path/to/video\" controls=\"controls\"></video></html>"
|
||||||
|
;;
|
||||||
|
"Link")
|
||||||
|
echo "[link][1]"
|
||||||
|
echo
|
||||||
|
echo "> Quote"
|
||||||
|
echo
|
||||||
|
echo "[1]: url"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
elif [[ $JEKYLL_FORMATTING == "textile" ]]; then
|
||||||
|
case $POST_TYPE in
|
||||||
|
"Text")
|
||||||
|
true
|
||||||
|
;;
|
||||||
|
"Quote")
|
||||||
|
echo "bq. Quote"
|
||||||
|
echo
|
||||||
|
echo "— Author"
|
||||||
|
;;
|
||||||
|
"Image")
|
||||||
|
echo "!url(alt text)"
|
||||||
|
;;
|
||||||
|
"Audio")
|
||||||
|
echo "<html><audio src=\"/path/to/audio/file\" controls=\"controls\"></audio></html>"
|
||||||
|
;;
|
||||||
|
"Video")
|
||||||
|
echo "<html><video src=\"/path/to/video\" controls=\"controls\"></video></html>"
|
||||||
|
;;
|
||||||
|
"Link")
|
||||||
|
echo "\"Site\":url"
|
||||||
|
echo
|
||||||
|
echo "bq. Quote"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi >> "${FNAME}"
|
||||||
|
|
||||||
# Convert the spaces in the title to hyphens for use in the filename
|
# Open the file in your favorite editor
|
||||||
|
"${JEKYLL_EDITOR:-${VISUAL:-${EDITOR:-${ALTERNATE_EDITOR:-nano}}}}" "${FNAME}"
|
||||||
FNAME_POST_TITLE=`echo $POST_TITLE | tr ' ' "-"`
|
ret="$?"
|
||||||
|
popd > /dev/null || return "$ret"
|
||||||
# Now, put it all together for the full filename
|
return "$ret"
|
||||||
|
|
||||||
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 %Y %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
|
|
||||||
|
|
||||||
# Generate template text based on the post type
|
|
||||||
|
|
||||||
if [[ $JEKYLL_FORMATTING = "markdown" ]]
|
|
||||||
then
|
|
||||||
if [[ $POST_TYPE = "Text" ]]
|
|
||||||
then
|
|
||||||
true
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $POST_TYPE = "Quote" ]]
|
|
||||||
then
|
|
||||||
echo "> Quote" >> $FNAME
|
|
||||||
echo >> $FNAME
|
|
||||||
echo "— Author" >> $FNAME
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $POST_TYPE = "Image" ]]
|
|
||||||
then
|
|
||||||
echo "" >> $FNAME
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $POST_TYPE = "Audio" ]]
|
|
||||||
then
|
|
||||||
echo "<html><audio src=\"/path/to/audio/file\" controls=\"controls\"></audio></html>" >> $FNAME
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $POST_TYPE = "Video" ]]
|
|
||||||
then
|
|
||||||
echo "<html><video src=\"/path/to/video\" controls=\"controls\"></video></html>" >> $FNAME
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $POST_TYPE = "Link" ]]
|
|
||||||
then
|
|
||||||
echo "[link][1]" >> $FNAME
|
|
||||||
echo >> $FNAME
|
|
||||||
echo "> Quote" >> $FNAME
|
|
||||||
echo >> $FNAME
|
|
||||||
echo "[1]: url" >> $FNAME
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $JEKYLL_FORMATTING = "textile" ]]
|
|
||||||
then
|
|
||||||
if [[ $POST_TYPE = "Text" ]]
|
|
||||||
then
|
|
||||||
true
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $POST_TYPE = "Quote" ]]
|
|
||||||
then
|
|
||||||
echo "bq. Quote" >> $FNAME
|
|
||||||
echo >> $FNAME
|
|
||||||
echo "— Author" >> $FNAME
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $POST_TYPE = "Image" ]]
|
|
||||||
then
|
|
||||||
echo "!url(alt text)" >> $FNAME
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $POST_TYPE = "Audio" ]]
|
|
||||||
then
|
|
||||||
echo "<html><audio src=\"/path/to/audio/file\" controls=\"controls\"></audio></html>" >> $FNAME
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $POST_TYPE = "Video" ]]
|
|
||||||
then
|
|
||||||
echo "<html><video src=\"/path/to/video\" controls=\"controls\"></video></html>" >> $FNAME
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $POST_TYPE = "Link" ]]
|
|
||||||
then
|
|
||||||
echo "\"Site\":url" >> $FNAME
|
|
||||||
echo >> $FNAME
|
|
||||||
echo "bq. Quote" >> $FNAME
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Open the file in your favorite editor
|
|
||||||
|
|
||||||
"$JEKYLL_EDITOR" $FNAME
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function testsite() {
|
function testsite() {
|
||||||
about 'launches local jekyll server'
|
about 'launches local jekyll server'
|
||||||
param '1: site directory'
|
param '1: site directory'
|
||||||
group 'jekyll'
|
group 'jekyll'
|
||||||
|
|
||||||
unset SITE
|
local SITE site
|
||||||
if [ -z "$1" ]
|
local -i ret
|
||||||
then
|
if [[ -z "${1:-}" ]]; then
|
||||||
echo "Error: no site specified."
|
echo "Error: no site specified."
|
||||||
echo "The site is the name of the directory your project is in."
|
echo "The site is the name of the directory your project is in."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for site in ${SITES[@]}
|
for site in "${SITES[@]}"; do
|
||||||
do
|
if [[ "${site##*/}" == "$1" ]]; then
|
||||||
if [ "${site##*/}" = "$1" ]
|
SITE="$site"
|
||||||
then
|
break
|
||||||
SITE=$site
|
fi
|
||||||
break
|
done
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ -z "$SITE" ]
|
if [[ -z "${SITE}" ]]; then
|
||||||
then
|
echo "No such site."
|
||||||
echo "No such site."
|
return 1
|
||||||
return 1
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
builtin cd $SITE
|
pushd "${SITE}" > /dev/null || return
|
||||||
jekyll --server --auto
|
jekyll --server --auto
|
||||||
|
ret="$?"
|
||||||
|
popd > /dev/null || return "$ret"
|
||||||
|
return "$ret"
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildsite() {
|
function buildsite() {
|
||||||
about 'builds site'
|
about 'builds site'
|
||||||
param '1: site directory'
|
param '1: site directory'
|
||||||
group 'jekyll'
|
group 'jekyll'
|
||||||
|
|
||||||
unset SITE
|
local SITE site
|
||||||
if [ -z "$1" ]
|
local -i ret
|
||||||
then
|
if [[ -z "${1:-}" ]]; then
|
||||||
echo "Error: no site specified."
|
echo "Error: no site specified."
|
||||||
echo "The site is the name of the directory your project is in."
|
echo "The site is the name of the directory your project is in."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for site in ${SITES[@]}
|
for site in "${SITES[@]}"; do
|
||||||
do
|
if [[ "${site##*/}" == "$1" ]]; then
|
||||||
if [ "${site##*/}" = "$1" ]
|
SITE="$site"
|
||||||
then
|
break
|
||||||
SITE=$site
|
fi
|
||||||
break
|
done
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ -z "$SITE" ]
|
if [[ -z "${SITE}" ]]; then
|
||||||
then
|
echo "No such site."
|
||||||
echo "No such site."
|
return 1
|
||||||
return 1
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
builtin cd $SITE
|
pushd "${SITE}" > /dev/null || return
|
||||||
rm -rf _site
|
rm -rf _site
|
||||||
jekyll --no-server
|
jekyll --no-server
|
||||||
|
ret="$?"
|
||||||
|
popd > /dev/null || return "$ret"
|
||||||
|
return "$ret"
|
||||||
}
|
}
|
||||||
|
|
||||||
function deploysite() {
|
function deploysite() {
|
||||||
about 'rsyncs site to remote host'
|
about 'rsyncs site to remote host'
|
||||||
param '1: site directory'
|
param '1: site directory'
|
||||||
group 'jekyll'
|
group 'jekyll'
|
||||||
|
|
||||||
unset SITE
|
local SITE site REMOTE
|
||||||
if [ -z "$1" ]
|
local -i loc=0 ret
|
||||||
then
|
if [[ -z "${1:-}" ]]; then
|
||||||
echo "Error: no site specified."
|
echo "Error: no site specified."
|
||||||
echo "The site is the name of the directory your project is in."
|
echo "The site is the name of the directory your project is in."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
loc=0
|
for site in "${SITES[@]}"; do
|
||||||
|
if [[ "${site##*/}" == "$1" ]]; then
|
||||||
|
SITE="$site"
|
||||||
|
# shellcheck disable=SC2153 # who knows
|
||||||
|
REMOTE="${REMOTES[loc]}"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
loc=$((loc + 1))
|
||||||
|
done
|
||||||
|
|
||||||
for site in ${SITES[@]}
|
if [[ -z "${SITE}" ]]; then
|
||||||
do
|
echo "No such site."
|
||||||
if [ "${site##*/}" = "$1" ]
|
return 1
|
||||||
then
|
fi
|
||||||
SITE=$site
|
|
||||||
REMOTE=${REMOTES[$loc]}
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
loc=$(($loc+1))
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ -z "$SITE" ]
|
pushd "${SITE}" > /dev/null || return
|
||||||
then
|
rsync -rz "${REMOTE?}"
|
||||||
echo "No such site."
|
ret="$?"
|
||||||
return 1
|
popd > /dev/null || return "$ret"
|
||||||
fi
|
return "$ret"
|
||||||
|
|
||||||
builtin cd $SITE
|
|
||||||
rsync -rz $REMOTE
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Load the Jekyll config
|
||||||
|
if [[ -s "$HOME/.jekyllconfig" ]]; then
|
||||||
|
source "$HOME/.jekyllconfig"
|
||||||
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue