~ 1 min read

Oneliner to Have Jekyll or Any Other Staticly Generated Blog Pushed to Repository

Once your blog is generated, you can commit and push it to the origin to be deployed (if you are using Git as a deployment instrument of course)

The oneliner defaults to a _site folder here in the example because this is what is usually used with the static site generators. Make sure to replace it with the correct path.

This also assumes that you are building the blog on your machine and are only pushing static files to the repository. You may want to do that to support custom plugins which Github's version of Jekyll does not support because it runs with a --safe flag on their servers

alias blog-delploy="cd ._site && git add -A && git commit -m 'blog-delploy UPDATE' & git push"

Here's a bonus oneliner that is Jekyll specific to build and deploy the blog. Just adding the build command in front

alias blog-delploy="jekyll build && cd ._site && git add -A && git commit -m 'blog-delploy UPDATE' & git push"

Alternatively with zsh you can do it in a much nicer format

function blog-delploy() {
    jekyll build &&
    cd _site &&
    git add -A && git commit -m 'blog-delploy UPDATE' &&
    git push
}