jekyll static site quickstart

by John H
~1 minute

This is directly from jekyllrb.com, the main website for jekyll.

  gem install bundler jekyll

  jekyll new my-awesome-site

  cd my-awesome-site

  bundle exec jekyll serve

# => Now browse to http://localhost:4000

Once you've installed and started all you have to do is goto your website directory in terminal and type the

bundle exec jekyll serve

This is important because it will autobuild your site. Also all of your links will be relative to the root directory so you can't really run the site effectively without serving it like a server would.

To Stop the Server

Hit cntrl+c in terminal.

Serving the Site on a production server

Upload your _site directory to the root of your server. You can also make your jekyll project a git repo and execute a git pull on the project which will pull down all of the rendered files in the _site directory. In order for the _site directory to be served you will need to configure your apache or nginx server to serve the _site directory as the directory folder

<VirtualHost *:80>
        ServerName domain.com
        ServerAlias www.domain.com
        DocumentRoot "/var/www/html/jekyll_website/_site/"
        DirectoryIndex index.html
    
    
</VirtualHost>

Related Articles

Marketing your Business: Where do I focus?

There are only 24 hours in a day and at least 8 of them are spent trying to make it rain. For 8...

John H John H
7 minutes

Dealing With Hacked Wordpress on EC2

I was going to start this article by saying that I'm a big fan of Wordpress, but I'm hesitating....

John H John H
8 minutes

Save Git Commit Changes to File

I've made some changes to my files in a git commit, and I want to keep track of all those...

John H John H
~1 minute