Created
December 11, 2017 11:16
-
-
Save iamkevingreen/09d20022830e5869e4cc0624d3aa6147 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
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