-
-
Notifications
You must be signed in to change notification settings - Fork 557
Closed
Labels
educationeducation: template languageLearning about a template language.Learning about a template language.template-language: nunjucks
Description
Given the following frontmatter:
fruit: Apple
is-it-tasty: YesI can access the first value within a collection loop using the item.data.fruit variable, and on pages by using fruit.
For the second value, given its hyphenated nature, I’ll need to use the bracket notation. Within a collection loop I can access it using item.data['is-it-tasty'], but how can I access this value on a page? I tried page.data['is-it-tasty'], but that didn’t work, nor did data['is-it-tasty']. What’s the expected approach?
(Side note: the apparent discrepancy between item.data.thing within loops, and just thing on pages keeps tripping me up 🙃.)
paulshryock, zachleat and robole
Metadata
Metadata
Assignees
Labels
educationeducation: template languageLearning about a template language.Learning about a template language.template-language: nunjucks