Logo

mobileteashop

Dennis Poon's blog and ersatz portfolio.

Recent Posts

Partial Templates in Jekyll (or not)

As I was applying the Prettify markup to our Developer Center for each code example, I started to get annoyed around the 10th copy-paste of the following:

<pre class="prettyprint linenums">
  <!-- Code Example Content -->
</pre>

Given the 30+ code examples in the doc base with more to come, it seemed to make sense to pull the markup into a partial template. I envisioned something like a regular Jekyll template, except that it could be included at-will on any page.

Unfortunately, fighting with the template mechanism yielded nothing, so I turned to the include tag.

(the TL;DR is that partial templates can only be approximated in a very hacky fashion in vanilla Jekyll, so feel free to skip this post if you’re looking for an elegant solution.)

view full post...


Finding Your Voice

Looking back at some of the posts I’ve written so far, one of the biggest things that stands out is the inconsistency of the written voice.

Duke University’s Creative Writing Primer explains voice as:

An author’s unique style and way of saying things. You should be able to recognize an author’s written voice the way you recognize a person’s spoken voice. In creative writing, one goal is to develop your written voice. Your voice should come across as natural, clear, and consistent, as unique to you as a fingerprint. Wordiness, awkward use of language, awkward sentence structure, and lack of clarity all serve to muffle the voice of the author.

The last time I remember thinking about voice was in high school English class, but it’s been on my mind more recently.

view full post...


Sub-Templates in Jekyll

Jekyll has been generally intuitive to use, but there are a few things that the documentation and most tutorials on the web deign not to explain/illustrate well.

In particular, sub-templates in Jekyll are often described as to ‘behave just as you’d expect’. However, I wouldn’t know what to expect because I have no idea how to structure one! A simple example or two would be very helpful, especially when comparing sub-templates with the include mechanism.

To be fair, once you see a sub-template, they really do behave as expected. So to close that gap, here is an example of a sub-template in Jekyll.

view full post...


view full post archive »