Jekyll is a pretty slick system, but if you’re not used to using ruby (and the gem package manager) it can be a bit tricky and if you’re like me you might give up on it all together for 6 months. Hopefully this short tutorial will help you avoid that.
Some assumptions
You’re a talented, passionate web developer who is confident using the command line and are not afraid to learn something new. Also, you’re working locally using a system with a command line that you understand (I’m on a Mac but these commands will work on Linux as well).
1. Install it
(This command will take a while to run.)
sudo gem install jekyll
2. Run it
Create a new skeleton project.
jekyll new $PROJECT_NAME
This command will watch for changes you make and regenerate files in the _site directory accordingly. I recommend doing this for development, it will function as your local server. Run it without -w to ignore changes made after the command executed, you’ll have to run the command again to see them.
jekyll serve -w
Just generate the _site/ files, don’t run the server:
jekyll build
3. Send it
I recommend using something like SVN or Git and Beanstalk/Springloops/etc for deployments, but to each their own so the first version is for FTP users, the second for my personal workflow.
FTP: Take everything in the _site directory and drop it into the final destination on the server. Jekyll builds SEO friendly URLs by creating the folder/file structure so there is no configuration required on your part after the upload is complete. If you do want to change something, run jekyll build
on your local machine before uploading ALL the files again. It’s important to note that jekyll makes changes to many files when you make configuration settings so make sure you push everything every time.
Git: git push
. That was easy, right? Your code is now off to the almighty cloud, ready for deployment. The service I will be showing is called Beanstalk. There’s really only one step there too, but it requires a bit of an explanation.
My repo includes everything, so all I have to do is change the repository path to push files from the /_site directory to the web server. Easy, right?