Pat Hawks

Read this first

Jekyll Meta Includes

The Problem

In Jekyll, I have a lot of code that will include a <meta> tag if a certian property is set.

The code for this looks terrible, and is terribly repetative.

{% if site.title %} <meta property="og:site_name" content="{{ site.title }}" /> {% endif %} {% if page.url %} <meta property="og:url" content="{{ page.url }}" /> {% endif %} {% if page.thumbnail %} <meta property="og:image" content="{{ page.thumbnail }}" /> {% endif %} {% if %} <meta property="article:published_time" content="{{ }}" /> {% endif %}


The Solution

I have come up with a solution!

Using Jekyll’s (new?) Include paramaters, I can create one file that checks to see if a certian variable exists and – if so – will include the proper <meta> tag.

This file looks like this.

{% if include.content %} <meta property="{{ }}" content="{{...

Continue reading →

Is Jekyll Lightweight?


Super lightweight CMS.

…once you install XCode (2.09 GB) and figure out how to get Ruby working.

Continue reading →

I hate Subversion

Pull Requests make Open Source Software.

GitHub makes Pull Requests easy.

When Pull Requests are easy, it encourages tinkering and sharing your changes upstream.

WordPress insists on using Subversion for the plugins repository. This makes tinkering and sharing changes quite difficult, as it has to be done through some external means of communication.

What I would love would be if started using GitHub for the plugins repository.

Short of that, I would like to host my plugin on both GitHub and the WordPress Subversion beast. I would like both repositories to always be in sync.
This is far easier said than done.

I have been able to import my WordPress plugin’s Subversion repo to Github, but I still don’t really have a way to push to both locations at the same time.
Yes, I have tried git-svn. What a mess.

I guess I will probably end up using GitHub for development, and just...

Continue reading →


iDesignTimes screenshot

I neither like you, nor follow you, nor do I appreciate the loud autoplaying video that has nothing to do with the content on the page.

This was my first time visiting your website; I followed a link from Techmeme.

If you pause the video, it will automatically resume playing (with sound) after an interval.

While not displayed here, if you scroll down just a bit, there is another Facebook/Twitter banner in the middle of the story!

I’ll not be returning.

Continue reading →

Cross-Origin Track

Can somebody please explain to me why <script>, <img>, <audio>, and <video> will happily display contents cross-origin, but <track> is freaking sacred and needs to follow much stricter rules?

This is madness!

If I can play a video from server X, why can’t I display captions from that server as well?

Continue reading →

HandBrake 0.9.9

It looks like the next version of HandBrake is nearing release.

For those not familiar, HandBrake is a wonderful video transcoder that supports many formats and lots of options for tweaking.

One of my favorite features from this new version (and one of the first you’re likely to notice) is the new interface for H.264 options. Rather than dealing with the Advanced panel, you can just specify the profile, level, and type of content to tune for.

For instance, if you need a video to work on a range of phones or tablets, you could specify Main profile, level 3.1 and tune for animation. Or maybe you’d tune for PSNR, or SSIM. And all this without having to deal with the Advanced options.

Still on my HandBrake wishlist:

  • Support for VP8 (or even the upcoming VP9)
  • More options for audio compression
  • OGG support, for encoding videos that work in older versions of Firefox (though I’m not holding...

Continue reading →

WebVTT Observations


The WebVTT Draft Spec has been updated to allow metadata headers. This corrects all the issues outlined in this post. :)

According to the WebVTT Draft Spec, a WebVTT file must start with the string “WEBVTT” followed by some text that does not include a line break, followed by two line breaks. This pretty much kills the idea of including header metadata. Yet, WebVTT files produced by YouTube break this rule and include some extra data in the header (along with line breaks), breaking the spec.

WEBVTT Kind: captions Language: en 

It would be nice if the spec allowed for metadata to be added like this. It would be nice if the spec allowed for something like RDF or microdata, but I understand that one of the beauties of WebVTT is its low markup to content ratio.

Additionally, it would be nice to have support for a GUID, or even an alternative content link to the webpage where this...

Continue reading →

Jekyll Spaghetti Code

So, it’s probably just because I’m a WordPress guy, but after using Jekyll for a while, I feel like it’s primitive templating system breeds unmaintainable spaghetti code.

I have lots of code duplicated in funny places, which is bad.

I have to resort to all sorts of tricks to minify my output, otherwise any line with nothing but a Liquid tag (there are many lines like this) will output an indented blank line.

Creating an ATOM feed that includes everything I’m used to including is a nightmare.

--- layout: minify-xml --- <?xml version="1.0" encoding="utf-8"?> <feed xmlns="" xmlns:geo="" xmlns:georss='' xmlns:thr='' xmlns:gd='' xmlns:wfw="" xmlns:slash=...

Continue reading →

Leaving Blogger

It has finally come to this.

After more than eight years, I have decided to dump Blogger and migrate somewhere else.

In some ways, this has been a long time coming. I haven’t considered Blogger to be the best blogging platform for many years, but there was one reason that I stuck it out.

Blogger was owned by Google, and Google is stable.

With the announcement this month that Google will be killing Google Reader (in just a few months !!), I can no longer trust Google to keep any services running over the long term.1

I liked the feeling that, even if I go broke or loose interest or die, Google will keep my blog running just the way it is, forever. Blogger is (was?) fairly unique in this aspect.

  • To use, of course, one needs to pay monthly fees for storage space.
  • To use, one needs to pay yearly fees to remove ads and point a domain name to the...

Continue reading →

HTML Does Not Need Retina Images

Smart people are spending a massive amount of time trying to solve a problem that doesn’t exist.
Trying to retrofit HTML to allow for things like quadruple-resolution images for HiDPI monitors, and lower quality images for slower connections (ie. mobile).

Adam7_passes.gif Why not just upload quadruple-resolution Adam7 interlaced PNGs and, if the browser does not support HiDPI, the browser can simply stop downloading the image after the fifth pass.

On mobile, or any other connection where bandwidth is more of a concern than quality, it could stop after an even earlier pass.

Either way, making most efficient use of bandwidth must be the job of the user agent more then the content itself.

There must be a better solution than adding new (redundant) tags to HTML.

Continue reading →