diff --git a/pages-eleventy/story.11ty.js b/pages-eleventy/story.11ty.js index e8713c1..144dcef 100644 --- a/pages-eleventy/story.11ty.js +++ b/pages-eleventy/story.11ty.js @@ -19,7 +19,55 @@ export const makeTitle = function ( app ) { } export const makeDescription = function ( app ) { - return `Latest reported support status of ${ app.name } on Apple Silicon and Apple M1 Processors when installed via Homebrew. ` + return `Reported status of ${ app.name } on Apple Silicon and the new Apple Macs. ` +} + +function makeFullUrlFromPath ( path ) { + return `${process.env.URL}${path}` +} + +// https://stackoverflow.com/a/34015511/1397641 +function makeJsonLdDate ( dateObject ) { + return dateObject.toLocaleDateString('en-US') +} + +function makeJsonLdObject ( data ) { + + const { + page, + app + } = data + + const fullUrl = makeFullUrlFromPath( page.url ) + + // console.log('app', app.payload.app ) + + return { + "@context": "https://schema.org", + "@type": "BlogPosting", + "mainEntityOfPage": { + "@type": "WebPage", + "@id": fullUrl + }, + "headline": data.mainHeading, + "description": data.description, + // "datePublished": makeJsonLdDate( new Date( app.payload.app.lastUpdated.raw ) ), + "dateModified": makeJsonLdDate( new Date( app.payload.app.lastUpdated.raw ) ), + "author":{ + "@type": "Organization", + "name": "Does It ARM" + }, + "publisher":{ + "@type": "Organization", + "name": "Does It ARM", + "logo": { + "@type": "ImageObject", + "url": "/images/mark.png", + "width": 100, + "height": 100 + } + } + } } function makeBookend () { @@ -111,7 +159,8 @@ export class Story { // console.log('video.payload', Object.keys(video.payload)) - // const lastUpdatedFriendly = makeLastUpdatedFriendly( app.lastUpdated ) + const lastUpdatedFriendly = makeLastUpdatedFriendly( app.lastUpdated ) + const jsonLd = JSON.stringify( makeJsonLdObject( data ) ) return /* html */` @@ -131,20 +180,21 @@ export class Story { - - + + - + + - - - + + + @@ -394,7 +444,7 @@ export class Story {
-