Lookbook v3 demo
Lookbook v3 info

Previews

Heading
Default
Sizes
Button
Default
Variants
Playground
Dropdown Menu
Default
Accordion
Default
Partials Page
Default
User Mailer
Welcome email

Pages

About
Preview Embeds
Frontmatter data
Prose
Pages Feature examples Frontmatter data

Using data from frontmatter

This is a test of frontmatter data access in pages.

The frontmatter for this page looks like this:

title: Using data from frontmatter label: Frontmatter data data: pets: - type: cat sound: meow - type: dog sound: woof

Page templates have access to the data set in frontmatter:

<% page.data.pets.each do |pet| %> * A <%= pet.type %> makes a '<%= pet.sound %>' noise. <% end %>

This is the output:

  • A cat makes a 'meow' noise.
  • A dog makes a 'woof' noise.
Preview Embeds Prose
v3.0.0.alpha.2