How to create an empty array

In your _config.yml initialize an empty array into a YAML property:

emptyArray: []

Then access that property in your Liquid template:

  {% assign my_array = site.emptyArray %}

You can push values into the array like so:

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

Get any item by its 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 the parent path). For example a file called about-us.md with have the ID of about-us. With this ID in hand you can now embed any post/collection item anywhere by filtering for it:

  {% assign post = site.posts | where: "id", 'about-us' | first %}

String concatenation

Append method:

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

Capture method:

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

Date formatting

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

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

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

GIFT

I've made a board game callled GIFT (Good Interesting Fun Times). It's a party game / word game for 2 to 6 players.

Check out the board game!