Created
September 23, 2019 05:46
-
-
Save cybertramp/bb54aeb5fba405e822b24459bb429cac to your computer and use it in GitHub Desktop.
write hugo post script and commit script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# ============================= | |
# | |
# Hugo fast commit script | |
# | |
# Created 19.09.23(paran_son@outlook.com) | |
# | |
# ============================= | |
hugo_path=`dirname $PWD`/hugo | |
var_date=`date +%F` | |
external_dir=`../blog/` | |
echo "Start commit" | |
${hugo_path} | |
rm -rf ${external_dir}* | |
cp -rf public/* ${external_dir} | |
git -C ${external_dir}. add . | |
git -C ${external_dir}. commit -m "${var_date}" | |
git -C ${external_dir}. push origin +master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# ============================= | |
# | |
# Hugo fast write script | |
# | |
# Created 19.09.23(paran_son@outlook.com) | |
# | |
# ============================= | |
## Hugo located under dirctory(../hugo) | |
hugo_path=`dirname $PWD`/hugo | |
now_date=`date +%F` | |
echo "Please input filename" | |
read input | |
${hugo_path} new post/${now_date}-${input}.md |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment