Skip to content

Instantly share code, notes, and snippets.

@fj fj/example.txt
Last active Apr 30, 2016

Embed
What would you like to do?
#####################################
# recipes.html
---
layout: showcase
title: Recipes
description: my favorite recipes
---
{% assign item_collection = site.recipes | sort: 'date_range' %}
#####################################
# animals.html
---
layout: showcase
title: animals
description: animals I own
---
{% assign item_collection = site.animals | sort: 'species_name' %}
#####################################
# layouts/showcase.html
<h1>{{page.title}}</h1>
<h2>{{page.description}}</h2>
{{ page.item_collection }} // This variable is empty even though it seems like we set it.
// How can we use a variable set in one of the pages in the layout?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.