Tuan-Anh Tran

Post scheduling with jekyll

Posted on August 9, 2014  •  1 minutes  • 148 words

First, update your _config.yml and set future to false . By doing this, jekyll will not publish any post with future date.

future: false

Setup a cronjob to check and rebuild the site if there’re posts to be published. Since I already setup a hook on post-receive (trigger on receving a git push) to rebuild the site, I’m going to set a cronjob to execute this script instead of writing something new. The content of the post-receive looks like this.

# post-receive
#!/bin/bash -l

jekyll build --source $TMP_GIT_CLONE --destination $PUBLIC_WWW

Cronjob that execute post-receive every hour at 0 minute, everyday.

@hourly /path/to/my/post-receive

The only downside of this is you need to be able to setup cronjob. GitHub Pages and shared hostings are probably not going to work in this case. You will need to verify this yourself.

Follow me

Here's where I hang out in social media