Switched to Jekyll

Was getting sick of having to use a DB for my personal site. Not only does it cause a hassle for maintenance, but it wastes resources. I miss the days of the old static Web, but I don't miss making changes to nav or overall structure across dozens or more HTML files.

I recently heard of Jekyll, which pre-processes Markdown into static HTML Web sites so I had to give it a shot.


It is just about as easy to update a wiki, with the exception of deployment. However, that can be scripted, or even automated if you need to take the time. I'm currently leaning on having the production server do a git pull every hour or so off of Github.

So the updating process should be about as simple as:

  1. Write a new file in markdown
  2. Save it
  3. Commit the file, then run git push to push it up to Github

Then the server should do the rest.


Since Jekyll was made primarilly for blogs, getting other somewhat dynamic content into the system is tricky. For my purposes, I wanted to have a section for my projects, as well.

In this case, I basically broke up the _posts directory into two sub directories. Each type used a different layout, an that was used to differentiate between the two. So my directory structure looks like this:


A blog file would have layout: post in the 'front-matter', and projects would have layout: project. In my index file, I make sure to check the page.layout variable to figure out what goes where.

<ul class="posts">
{% for post in site.posts %}
    {% if post.layout == 'post' %}
        <a href="{{ post.url }}">{{ post.title }}</a><br />
        <span>{{ post.date | date_to_string }}</span>
        <p>{{ post.excerpt }}</p>
    {% endif %}
{% endfor %}
<ul class="projects">
{% for post in site.posts %}
    {% if post.layout == 'project' %}
        <a href="{{ post.url }}">{{ post.title }}</a><br />
        <span>Updated {{ post.update | date_to_string }}{% if post.status %} ({{ post.status }}){% endif %}</span>
    {% endif %}
{% endfor %}

This allowed the front page to look like it does.