Jan 14, 2014

Harp all the things: silentrob.me

So I had this idea late last year, but this is going to be the year I see it though. My goal—simple, convert every site I made to a static Harp site.

Obviously, every site I still have access to and it makes sense to port to static. I will document the process and challanges along the way.

So lets start with this site my personal blog. The canonical hello world.

silentrob.me

Previous Setup

New Setup

So converting this site was really easy. Brock and I launched our blogs the at the same time on the Slicehost box back in May 2, 2012 when we went out on our own.

The inital framework and design Brock had thown together and from the beginning it was Harpish even though it was 8 months before harp really existed. There were however a few little challanges.

One of the things that needed to be changed was a cached call to GitHub to fetch repos displayed in the projects section. Previously we had a call that would save the results in Redis for 5 minutes to reduce http requests.

The endpoint was just public JSON and I was not even doing anything fancy with it.

https://api.github.com/users/silentrob/repos

So for the first pass, I'm going to treat it as Metadata and iterate over it from a _data.json file.

I include a partial called _projects.jade with the following code:

    .row.content
      .col-md-8.col-md-offset-3
        h2 Projects
        ul.projects
          each repo in public._data
            li
              h3
                a(href="#{ repo.html_url }")= repo.name

I could have just loaded the repo data a client side XHR, using jQuery, and probably would have in 2011 but what fun would that be.

So I hope this helps, and I will continue to do more articles like this and cover more complicated topics.

Written by Rob Ellis