Skip to content

Instantly share code, notes, and snippets.

@fj
Last active April 30, 2016 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fj/9276812e01534b194083109bd48645fc to your computer and use it in GitHub Desktop.
Save fj/9276812e01534b194083109bd48645fc to your computer and use it in GitHub Desktop.
#####################################
# 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