Skip to content
HTML CSS JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/ISSUE_TEMPLATE
archetypes
content/blog
layouts
static
.gitignore
.gitmodules
LICENSE.md
README.md
config.toml

README.md

Build and update live site

hugo -d ~/Webs/kainlite.github.io
c kainlite.github.io
gadd && gc -m "Message" && ggpush

If those fancy aliases looks like something you might like to have check my dotfiles and oh-my-zsh :)

This handy pre-push hook will push the changes automatically when pushing to this repo with the same commit message. Save as .git/hooks/pre-push and give it +x permissions to it.

#!/bin/bash

COMMIT_MESSAGE=`git log -n 1 --pretty=format:%s ${local_ref}`

hugo -d ~/Webs/kainlite.github.io
ANYTHING_CHANGED=`cd ~/Webs/kainlite.github.io && git diff --exit-code`
if [[ $? -gt 0 ]]; then
    cd ~/Webs/kainlite.github.io && git add . && git commit -m "${COMMIT_MESSAGE}" && git push origin master
fi

This way we don't have to do anything manually in the other repo but to commit the proper changes here.

You can’t perform that action at this time.