Skip to content
jpgerdeman edited this page Aug 12, 2012 · 2 revisions

Building The Site

Quickstart

Install jekyll

Install ruby and call

sudo gem install jekyll

For issues on Ubuntu see below.Calling jekyll from within the gh-pages branch compiles it. Github uses the folowing command to compile sites

jekyll --pygments --safe

To start the server

jekyll --pygments --safe --server --base-url='/minifig-svg-decals' --auto

This will start a server so your jekyll page should be accessible under localhost:4000/minifig-svg-decals7index.html. Change the value of site.url in the _config.yml to localhost:4000 during local development. The jekyll server will ignore changes to the _config.yml so don't forget to restart it after changes.

Run The Buildscript

The Buildscript is written in ruby. So once you have jekyll running, you have everything you need to run the buildscript. Inkscape has to be installed and available in the PATH variable. On Windows the inkscape-cli wrapper is also needed.

Call the build script from within the _builddirectory

ruby.run.rb

This will generate thumbnails, renders and table of contents for each directory. Afterwards everything is copied over to the _decal directory.

Preambel

The site is published on GitHub-Pages. GitHub only serves static sites, this is incredibly beneficial to server usage especially combined with a cache.

GitHub uses jekyll to render compile sites to static html.

Jekyll

Jekyll like staticmatic is a static site generator. This means that a designer can dynamically react and include things (like a layout), but before the pages are published all this is compiled to static html.

Jekyll compiles and copies everything in the directories to its publishing directory (usually _sites). Directories with underscore are ignored though. This means that you can ignore Jekyll altogether and just write pure html files yourself.

There are pretty good guides available at the Jekyll repository. Also Jekyll-Bootstrap is quite helpful as it provides further explanations and some code to get started. Also Jekyll uses Liquid as template engine, so have a lokk at that as well.

Setting up Jekyll

To set up Jekyll you need to have ruby installed. Afterwards you can install Jekyll as descirbed above.

To install Jekyll on Ubuntu 10.04 you need to have a newer version of rubygems than available in the repository. You need to install it from this PPA. Also Ubuntu won't put the ruby gems into the PATH variable add lib/gem/... to the PATH in your lib.env

Limitations

Only the values defined in the _config.yml and the front matter are passed to the templates. It's possible to define your own variables, but you're limited in the information available. It's impossible to define a hierarchical menu dynamically, rather you are supposed to define it in your _config.yml or just write the according html.

{% comment %}<!--
A comment
-->{% endcomment %}

{% if bar == foo %}
	{% include myinclude %}
    {% else %}
        {% for node in pages_list %}
            {% if node.title != null %}
                 {% if group == null or group == node.group %}
                     {% capture depth %}{{ node.url | split:'/' | size }}{% endcapture %}
                    	{% if page.url == node.url %}
                            	<li class="depth-{{depth}} active"><a href="{{site.url}}/{{site.baseurl}}/{{node.url}}" class="active">{{node.title}}</a></li>
                    	{% else %}
                             	<li class="depth-{{depth}}"><a href="{{site.url}}/{{site.baseurl}}/{{node.url}}">{{node.title}}</a></li>
                     	{% endif %}
                            {% assign depth = nil %}
                        {% endif %}
                  {% endif %}
             {% endfor %}
         {% endif %}
     {% assign pages_list = nil %}
    {% assign group = nil %}