Skip to content

Instantly share code, notes, and snippets.

@iamkevingreen
Created December 11, 2017 11:16
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 iamkevingreen/09d20022830e5869e4cc0624d3aa6147 to your computer and use it in GitHub Desktop.
Save iamkevingreen/09d20022830e5869e4cc0624d3aa6147 to your computer and use it in GitHub Desktop.
const RenderModules = require('../components/RenderModules')
const MapModules = (modules) => {
return modules.map((module) => {
const type = module.sys.contentType ? module.sys.contentType.sys.id : false
return RenderModules(module, type)
})
}
module.exports = (data) => {
return `
<div class='single'>
<div className='article__hero rel'>
<div class='obj-fit abs fill js-obj-fit-image lazy-img'>
<img class='fill-h fill-v abs fill' data-normal='${data.featuredImage.fields.file.url + '?fm=jpg&fl=progressive'}' />
</div>
</div>
<section className='bgw z0 rel'>
<div className='rel pt2'>
<div className='outer container--c container--a'>
<h4 className='mb0 serif'>${data.passportTitle}</h4>
</div>
</div>
</section>
<div className='z0 bgw px2'>
${MapModules(data.contentModules)}
</div>
</div>
</div>
`
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment