diff --git a/pages-eleventy/formula.11ty.js b/pages-eleventy/formula.11ty.js index 526197f..6d0bc2d 100644 --- a/pages-eleventy/formula.11ty.js +++ b/pages-eleventy/formula.11ty.js @@ -4,6 +4,8 @@ import config from '../nuxt.config.js' import { getAppType } from '../helpers/app-derived.js' +import { AppTemplate } from './app.11ty.js' + // import VideoRow from '../components-eleventy/video/row.js' // import { isVideo } from '../helpers/app-derived' @@ -18,7 +20,7 @@ export const makeDescription = function ( app ) { return `Latest reported support status of ${ app.name } on Apple Silicon and Apple M1 Processors when installed via Homebrew. ` } -class FormulaTemplate { +class FormulaTemplate extends AppTemplate { // or `async data() {` // or `get data() {` data () { @@ -28,7 +30,7 @@ class FormulaTemplate { pagination: { data: 'eleventy-endpoints', size: 1, - alias: 'formula', + alias: 'app', before: function( data ) { return data.filter( entry => { const appType = getAppType( entry.payload.app ) @@ -39,59 +41,25 @@ class FormulaTemplate { }, eleventyComputed: { - title: ({ formula: { payload: { app } } }) => { + title: ({ app: { payload: { app } } }) => { // console.log('data', data) return makeTitle( app ) }, - description: ({ formula: { payload: { app } } }) => { + description: ({ app: { payload: { app } } }) => { return makeDescription( app ) }, + mainHeading: ({ app: { payload: { app } } }) => { + return `Does ${ app.name } work on Apple Silicon when installed via Homebrew?` + } }, - permalink: ({ formula }) => { - // console.log('payload', formula.payload) - return formula.route.substring(1) + '/' + permalink: ({ app }) => { + // console.log('payload', app.payload) + return app.route.substring(1) + '/' } } } - render({ formula: { payload: { app } } }) { - - // console.log('video.payload', Object.keys(video.payload)) - - const relatedLinksHtml = app.relatedLinks.map( (link, i) => { - return /* html */` - ${ (i === 0) ? 'View' : link.label } - ` - } ).join('') - - return /* html */` -
-
-

- Does ${ app.name } work on Apple Silicon when installed via Homebrew? -

-

- ${ app.text } -

- -
- ${ app.content } -
- - -
-
- ` - } } module.exports = FormulaTemplate