BC Wiki - Jekyll for Static Sites

Category: software


GitHub Pages Generates Sites With Jekyll

Jekyll is a tool called a “static site generator”. The goal of a static site generator is to effectively separator a site’s content from its layout and style.

In Jekyll, content is stored in Markdown, a simple markup language designed for simplicity and readability. The site’s layout is built up from page templates using Markdown, HTML (including insertable reusable fragments), and a simple programming language called “liquid tags”. Each page, and the site overall, can have metadata stored in YAML (“Yet Another Markup Language”) that can be used to select templates and define variables that are used to build the page. When Jekyll is run, it processes the templates, tags, metadata, and content and generates HTML files that can be served by Jekyll itself or another webserver like Apache or nginx.

In 2016-04, GitHub announced they were standardized on one Markdown engine, kramdown, for GitHub Pages. Kramdown extends vanilla Markdown with some additional syntax, including inline attribute lists for assigning classes to block and inline elements without the use of HTML tags.

Building a site with Jekyll

Jonathan McGlone’s Creating and Hosting a Personal Site on GitHub is the best guide I’ve found so far, especially for someone who wants to take a totally custom ground-up approach and not just recycle a template.

The official documentation has a page on customizing a static site built with Jekyll using options in the _config.yml file. YAML options can even be nested lists.

Many tutorials discuss how to configure your site as a blog using a _blogpost collection, but the collections feature is flexible and powerful enough to implement all kinds of site structures.

Liquid tags are the key to fully utilizing Jekyll; they’re discussed in-depth in the Shopify documentation (Shopify is a tool built on Jekyll).

Academic Pages Using Jekyll

Practical Use

Alternatives to Jekyll

Gotchas

Avoid problems with relative links by using <pre>http://bcwiki.brandoncurtis.com</pre> in Liquid scripts.

Moving from Mediawiki

Philip Ashlock’s Mediawiki-to-Markdown converter will convert your wiki’s XML dumps directly to Markdown with frontmatter (or any one of a variety of other Pandoc-supported formats).

Resources

Jekyll guides

Other articles