Date formatting

Format a date by appending a date filter to your variable like this:

  {{ | date: '%Y %B %d' }}

Here are the docs and here’s a handy reference on the %placholders.

String concatenation

Method #1

Use assign:

  {% assign new_var = var_first | append: ' - ' | append: var_second %}

Method #2

Use capture:

  {% capture new_var %}{{ var_first }} - {{ var_second }}{% endcapture %}

Data structures

Instantiate an empty array

In your _config.yml add a variable like:

emptyArray: []

Then in your Liquid template do:

  {% assign my_array = site.emptyArray %}


Push data into an array

  {% assign my_array = my_array | push: '<value>' %}


Get an object by ID

The ID of any posts or collection item in Jekyll will be its filename. This is what you see in the URL as the item’s path (not including parent paths). Example: about-us for a file called

  {% assign post = site.posts | where: "id", <item_id> | first %}


Kickstarter Coming March 2018

I'm launching a board game called Delivery Duck. You're a duck, in a truck, delivering packages. It's a strategic family game for 2 to 6 players.

Check out the board game!