Make eleventy js templates asynchronus

This commit is contained in:
Sam Carlton 2021-05-08 15:31:01 -05:00
parent bb40fd294c
commit 84355645bf
4 changed files with 16 additions and 10 deletions

View file

@ -57,10 +57,14 @@ class TV {
}
}
render({ payload: { video } }) {
async render({ payload: { video } }) {
// console.log('video.payload', Object.keys(video.payload))
const rowHtml = await this.boundComponent(VideoRow)( video.payload.relatedVideos )
// const rowHtml = renderedRow.join('')
return /* html */`
<section class="container pb-16">
<div class="flex flex-col items-center text-center space-y-6">
@ -87,7 +91,7 @@ class TV {
<div class="related-videos w-full">
<h2 class="subtitle text-xl md:text-2xl font-bold mb-3">Related Videos</h2>
${ this.boundComponent(VideoRow)( video.payload.relatedVideos ) }
${ rowHtml }
</div>