This is a boilerplate to be used for Jekyll-assignments in the course. The virtual machine (hashicorp/precise32) will have the following (relevant) packages installed:
From start:
- node.js (Latest stable)
- npm
- git
- bundler
From npm install:
- jekyll (via bundler)
- scss (via bundler)
Make sure you have the following installed on your system:
- Virtual Box https://www.virtualbox.org/
- Vagrant https://www.vagrantup.com/
Now, do:
-
Pull (
git pull https://github.com/1dv022/jekyll-boilerplate.git
) into your existing repo. Make sure you are in the root of your repo. -
Start the virtual machine using
vagrant up
(May take 10-30 minutes this first time. Ignore red command line statements and warnings.) -
SSH into the machine using
vagrant ssh
(Now you are connected to the virtual machine. Every command is now executed in the virtual mashine. If you doexit
you leave the virtual machine and are back on your local computer.) -
Install bundler with
gem install bundler
. Then install decencies and github-pagesnpm install
(if you are on Windows use the commandnpm install --no-bin-links
). It will now install some packages and it could take a while. -
Create an scaffolded jekyll project using
jekyll new src
(src
to install in the directory (/vagrant/src
)
-
Start out by
vagrant up
your machine and ssh into it (vagrant ssh
) -
Start watching for changes in the jekyll files.
npm run watch
-
Open up a browser and visit the url
http://localhost:4000
To get the css working you have to make a change in the/src/_config.yml
-file - Changeurl: "http://example.com"
tourl: ""
to get the correct path. -
Fire up the IDE of your choise (Webstorm, sublime etc.) and open the files in the
src
-folder and start editing your site. When a file is saved the watch-script will auto generate the site. (including sass-files but not true for _config.yml) -
When you are done simply
ctrl+c
to abort the watch,exit
to exit the ssh-session and do avagrant halt
to stop the machine orvagrant suspend
to only suspend it.