Created
February 28, 2018 19:58
-
-
Save OutThisLife/69e362fabc429e898687c541db5b1ff5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Pretend this is in a store somewhere. | |
const pageData = { | |
title: 'My Data', | |
copy: 'Lorem ipsum dolar sit amet', | |
fields: { | |
testimonial: { | |
name: 'Bob Ross', | |
copy: 'Everything is amazing' | |
}, | |
rating: 5 | |
} | |
} | |
// ---- | |
const { | |
title, copy, | |
fields: { rating, testimonial } | |
} = pageData | |
return ` | |
<h1>${title} <em>(${rating} out of 5)</em></h1> | |
<p>${copy}</p> | |
<blockquote> | |
<p>${testimonial.copy}</p> | |
<cite>${testimonial.name}</cite> | |
</blockquote> | |
` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment