mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-15 06:35:20 -07:00
Add meta for tv pages
This commit is contained in:
parent
3a2326baa9
commit
2342c01b7e
4 changed files with 67 additions and 12 deletions
|
|
@ -1,11 +1,30 @@
|
|||
import dotenv from 'dotenv'
|
||||
|
||||
import config from '../nuxt.config'
|
||||
|
||||
import VideoCard from '../components-eleventy/video/card.js'
|
||||
|
||||
// Setup dotenv
|
||||
dotenv.config()
|
||||
|
||||
export const makeTitle = function ( video ) {
|
||||
return `${ video.name } - ${ config.head.title }`
|
||||
}
|
||||
|
||||
export const makeDescription = function ( video ) {
|
||||
if ( video.payload.featuredApps.length === 0 ) return 'Apple Silicon performance and support videos'
|
||||
|
||||
const featuredAppsString = video.payload.featuredApps.slice(0, 5).map(app => app.name).join(', ')
|
||||
|
||||
// console.log('video.payload.featuredApps', video.payload.featuredApps)
|
||||
|
||||
return `Apple Silicon performance and support videos for ${ featuredAppsString }`
|
||||
}
|
||||
|
||||
class TV {
|
||||
// or `async data() {`
|
||||
// or `get data() {`
|
||||
data() {
|
||||
data () {
|
||||
return {
|
||||
layout: 'default.11ty.js',
|
||||
|
||||
|
|
@ -18,11 +37,11 @@ class TV {
|
|||
eleventyComputed: {
|
||||
title: ({ video }) => {
|
||||
// console.log('data', data)
|
||||
return `${ video.name } - ${ config.head.title }`
|
||||
return makeTitle( video )
|
||||
},
|
||||
description: ({ video }) => {
|
||||
return makeDescription( video )
|
||||
},
|
||||
// footerInlineScripts: () => [
|
||||
// 'node_modules/lazysizes/lazysizes.min.js'
|
||||
// ]
|
||||
},
|
||||
|
||||
permalink: ({ video }) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue