Set up video and date elements

This commit is contained in:
Sam Carlton 2021-03-06 21:41:41 -06:00
parent 86f61b1251
commit aa28439519

View file

@ -3,6 +3,8 @@ import dotenv from 'dotenv'
import config from '../nuxt.config.js' import config from '../nuxt.config.js'
import { getAppType } from '../helpers/app-derived.js' import { getAppType } from '../helpers/app-derived.js'
import { makeLastUpdatedFriendly } from '../helpers/parse-date'
import VideoRow from '../components-eleventy/video/row.js' import VideoRow from '../components-eleventy/video/row.js'
@ -31,6 +33,7 @@ export class AppTemplate {
data: 'eleventy-endpoints', data: 'eleventy-endpoints',
size: 1, size: 1,
alias: 'app', alias: 'app',
before: function( data ) { before: function( data ) {
return data.filter( entry => { return data.filter( entry => {
const appType = getAppType( entry.payload.app ) const appType = getAppType( entry.payload.app )
@ -66,6 +69,8 @@ export class AppTemplate {
// console.log('video.payload', Object.keys(video.payload)) // console.log('video.payload', Object.keys(video.payload))
const lastUpdatedFriendly = makeLastUpdatedFriendly( app.lastUpdated )
const relatedLinksHtml = app.relatedLinks.map( (link, i) => { const relatedLinksHtml = app.relatedLinks.map( (link, i) => {
return /* html */` return /* html */`
<a <a
@ -97,6 +102,7 @@ export class AppTemplate {
</div> </div>
</div> </div>
${ relatedVideos.length > 0 ? /* html */`
<div <div
v-if="relatedVideos.length !== 0" v-if="relatedVideos.length !== 0"
class="related-videos w-full" class="related-videos w-full"
@ -108,23 +114,25 @@ export class AppTemplate {
${ this.boundComponent(VideoRow)( relatedVideos ) } ${ this.boundComponent(VideoRow)( relatedVideos ) }
</div> </div>
` : '' }
<div class="report-links py-24 text-xs shadow-none"> <div class="report-update text-xs text-center w-full shadow-none py-24">
<div v-if="app.lastUpdated"> ${ lastUpdatedFriendly !== null ? /* html */`
<div>
<time <time
datetime="${'app.lastUpdated.raw'}" datetime="${ app.lastUpdated.raw }"
> >
Last Updated {{ lastUpdatedFriendly }} Last Updated ${ lastUpdatedFriendly }
</time> </time>
</div> </div>
` : '' }
<!-- https://eric.blog/2016/01/08/prefilling-github-issues/ --> <!-- https://eric.blog/2016/01/08/prefilling-github-issues/ -->
<a <a
href="https://github.com/ThatGuySam/doesitarm/issues?q=is%3Aissue+is%3Aopen+${ app.name }" href="https://github.com/ThatGuySam/doesitarm/issues?q=is%3Aissue+${ app.name }"
target="_blank" target="_blank"
class="underline" class="underline"
rel="noopener" rel="noopener"
>Report Update</a> >Report Update</a>
</div> </div>
</section> </section>