MappingVermont bio photo


Twitter Github

Migrating to Jekyll

I started this blog using Wordpress, and put some significant time into customizing my WP installation. I found a theme I liked, edited a lot of the settings, installed some plugins to style my site. Things were looking pretty good, I thought, until I visited the site at work. Even with the the uber-fast internet we have, I was staring at a blank page for a few seconds before it loaded. After doing research, it became clear that in addition to the added plugins, the PHP-driven nature of a dynamic CMS was slowing things down.

In addition to poor loading times, the lack of transparency frustrated me. There were hundreds of files in the wp-admin folder on my site, and I had no idea how they worked. I had some control over the website layout (theme, background image, text), and could use plugins to achieve the rest (code syntax highlighting, disqus comments, analytics), but each of these had to be configured or installed in the admin interface. Even the text editor started to annoy me, and I ended up writing most of my text in Notepad++ and pasting it in to the WYSIWYG editor format it.

I started looking around for a lightweight CMS. I don’t know much about web programming, and didn’t know what to expect. Was it possible to use a designer-built theme, but make custom tweaks to the HTML? Could I get away with not using a database? Would it be easy to migrate if I changed hosting providers? Enter Jekyll, a static site generator written in Ruby that makes it easy to directly edit page HTML and even easier to format blog posts in your favorite text editor.

After a brief false start trying to publish my blog via GitHub Pages, I installed Ruby and Jekyll locally. I downloaded a great theme from Michael Rose and went to work putting together the site. Posts are stored as text files, which are then processed by Jekyll into static HTML, complete with all formatting of your theme. Jekyll uses Markdown to parse these text files, making it easy to format my text using pre-set tags. For example, to highlight syntax in a chunk of code, I can include the {% highlight python %} tag:

for example in exampleList:
	print "This is Jekyll"

Not bad huh? Other Markdown tags allow for heading formatting, block quotes, and more. When I finish a post I run Jekyll, then copy the static site (folders, data, and pages) to my web hosting service. Looking forward to developing some Leaflet storymap templates and deploying them with Jekyll– stay tuned.

comments powered by Disqus