diff --git a/pages-eleventy/story.11ty.js b/pages-eleventy/story.11ty.js index 144dcef..2b34840 100644 --- a/pages-eleventy/story.11ty.js +++ b/pages-eleventy/story.11ty.js @@ -5,6 +5,8 @@ import config from '../nuxt.config.js' import { hasStory, getStoryEndpoint } from '../helpers/app-derived.js' import { makeLastUpdatedFriendly } from '../helpers/parse-date' +import CoverPage from '../components-eleventy/story/cover.js' + // import VideoRow from '../components-eleventy/video/row.js' @@ -128,6 +130,7 @@ export class Story { description: ({ app: { payload: { app } } }) => { return makeDescription( app ) }, + mainHeading: ({ app: { payload: { app } } }) => { return `Does ${ app.name } work on Apple Silicon?` }, @@ -140,6 +143,36 @@ export class Story { } } + buildPages ( data ) { + const pages = [] + + const { + // content, + // title = null, + app: { + payload: { + app + } + } + } = data + + + // console.log('video.payload', Object.keys(video.payload)) + + const lastUpdatedFriendly = makeLastUpdatedFriendly( app.lastUpdated ) + + // Build cover page + pages.push({ + template: CoverPage, + heading: `${ app.name } has been reported to support Apple Silicon nativelty as of ${lastUpdatedFriendly}!`, + headingUrl: '', + imageUrl: '/images/backgrounds/liquid-cheese.svg' + }) + + + return pages + } + render( data ) { // const { app: { payload: { app } } } = data @@ -162,6 +195,12 @@ export class Story { const lastUpdatedFriendly = makeLastUpdatedFriendly( app.lastUpdated ) const jsonLd = JSON.stringify( makeJsonLdObject( data ) ) + const pages = this.buildPages( data ) + + const pagesHtml = pages.map( page => { + return this.boundComponent( page.template )( page ) + } ).join('') + return /* html */` @@ -446,16 +485,18 @@ export class Story { + ${ pagesHtml } + - +
-

Ack has  been reported to support Apple Silicon nativelty as of Oct 31st, 2020!

+

Ack has  been reported to support Apple Silicon nativelty as of ${lastUpdatedFriendly}!