Skip to content

Instantly share code, notes, and snippets.

@davidrleonard
Created January 7, 2015 21:28
Show Gist options
  • Save davidrleonard/0fc96dacfda6b6ad5828 to your computer and use it in GitHub Desktop.
Save davidrleonard/0fc96dacfda6b6ad5828 to your computer and use it in GitHub Desktop.
Jekyll/Liquid: Create fake-ish hash
{% assign test-topics = 'topic-one\Topic One|topic-two\Topic Two|topic-three\Topic Three' | split: '|' %}
{% for entries in test-topics %}
{% for topic in entries %}
<!-- topic = 'topic-one\Topic One' -->
<p>First: {{ topic | split: '\' | first }}</p><!-- First: topic-one -->
<p>Second: {{ topic | split: '\' | last }}</p><!-- Second: topic-two -->
{% endfor %}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment