Skip to content

Instantly share code, notes, and snippets.

@jmacego

jmacego/jekyllserve.sh

Last active Mar 14, 2019
Embed
What would you like to do?
Bash function to pull jekyll site and serve
#!/bin/bash
# Profile function to add a convenient jekyllserve command and also a
# function to cd to the directory, do a git pull, open in sublime,
# serve the site and then open it in a web browser.
#
# Works on OSX with sublime CLI installed. YMMV for other platforms.
# You also probably want to rename things. Consider this a template.
#
# Also... I just have this in my ~/.profile so I type jmaclabs and it
# just works. Here's how that looks different:
# Aliases and Functions:
#
# alias jekyllserve="bundle exec jekyll serve --watch --livereload --host 0.0.0.0 --port 8000"
#
# jmaclabs() {
# cd ~/git/jmacego.github.io
# git pull
# subl .
# bash -c "sleep 5; open 'http://localhost:8000'" &
# jekyllserve
# }
jmaclabs() {
cd ~/git/jmacego.github.io
git pull
subl .
bash -c "sleep 5; open 'http://localhost:8000'" &
bundle exec jekyll serve \
--watch \
--livereload \
--host 0.0.0.0 \
--port 8000
}
jmaclabs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.