published on in tech
tags: python hugo shell git linux

How to update hugo blog

Quick Start

    1. Open iTerm2
    1. control+command+h to open the tab with hugo profile
    1. addblog to create a new blog post, hugo command will create a new post tesmplate and subl command will help open it.
    1. Note: Blog Title should not contain space and strip out menu = "main" in the template.
    1. deployblog to deploy newest update to github.

Detail

create blog shell script:

echo "Blog Title: "
read Title
cd /Users/DanielGong/HugoSite/testsite
hugo new post/$Title.md
subl /Users/DanielGong/HugoSite/testsite/content/post/$Title.md

eploy blog shell script:

echo "-------Begin-------"

cd /Users/DanielGong/HugoSite/testsite
hugo --theme=gs-hyde --baseUrl="http://danigong.github.io/"
cd public
git add -A
git commit -m "auto_commit"
git push origin master

echo "-------Done-------"

customize command:

Add alias addblog="xxx.sh" into .bashrc file. Then source ~/.bashrc