Skip to content

Instantly share code, notes, and snippets.

@beatricebock
Last active February 24, 2017 07:32
Show Gist options
  • Save beatricebock/c696f3b54d84ed80cbf432cb31cee109 to your computer and use it in GitHub Desktop.
Save beatricebock/c696f3b54d84ed80cbf432cb31cee109 to your computer and use it in GitHub Desktop.
How to deploy a Jekyll website using Github

Jekyll is a gem based on Ruby and Rails. It's a framework-type thing that people use to create blogs quickly. Jekyll is great because it's simple, but powerful. Devs love it because working with and managing content using Jekyll is a lot like coding, so it's an environment we're all familiar with. Jekyll allows you to have a static site up and running in literal minutes.

  1. Initialize a github repo using this format: your-username.github.com. For me, it'll look like this: trisssss.github.io.

  2. In your local computer, install the Jekyll Gem (make sure you have Ruby and Rails installed beforehand) by typing: gem install Jekyll in your shell.

  3. After the gem has been installed, type jekyll new your-folder-name into the shell. You can replace "your-folder-name" with anything you want.

  4. Navigate into your new folder using cd. For example, I'll type cd your-folder-name since "your-folder-name" was what I created by new Jekyll folder with.

  5. Once you're inside your new folder, you can try out your new site by typing jekyll serve. Then, open up your browser and type http://localhost:4000 in the URL bar.

  6. You should be seeing a preview of your site. Pretty cool, eh? Now, once you're done playing around in the site, type CTRL+C in the shell to stop the server.

  7. Run these commands to initialise git inside your new folder.

  8. git init

  9. git remote add origin https://github.com/your-user-name/your-user-name.github.io.git "your-user-name" should be replaced with your own username.

  10. git add .

  11. git commit -m "Initialise repo and upload files" Again, you can write anything in betweeen the " "

  12. git push -u origin master

  13. And, you're done! Just type your repo's name in the browser URL and your site should pop up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment