Skip to content

Instantly share code, notes, and snippets.

@chris-muller
Last active March 29, 2016 00:18
Show Gist options
  • Save chris-muller/cb31cf22812bdb889ae8 to your computer and use it in GitHub Desktop.
Save chris-muller/cb31cf22812bdb889ae8 to your computer and use it in GitHub Desktop.
Example code for a 'related links' include.

#Usage Use the below code to include a post from your posts with a title of "Hello World!" You can change the collection that the include uses instead of using posts.

{% include related.html item="Hello World!" collection=site.posts %}

Could also be changed to match a custom variable instead of title if name collisions are a concern.

layout title date categories
post
Test content
2016-02-25 19:30:21 +1100
hello

test content

{% include related.html item="Hello World!" collection=site.posts %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment