1
0
mirror of https://git.sr.ht/~cadence/cloudtube synced 2024-11-12 19:37:29 +00:00
cloudtube/pug/includes/video-list-item.pug
2020-10-18 21:51:09 +13:00

21 lines
825 B
Plaintext

mixin video_list_item(video, instanceOrigin)
- if (!instanceOrigin) instanceOrigin = "https://i.ytimg.com"
- let link = `/watch?v=${video.videoId}`
a(href=link tabindex="-1").thumbnail
img(src=`${instanceOrigin}/vi/${video.videoId}/mqdefault.jpg` width=320 height=180 alt="").image
if video.second__lengthText != undefined
span.duration= video.second__lengthText
.info
div.title: a(href=link).title-link= video.title
div.author-line
a(href=`/channel/${video.authorId}`).author= video.author
- const views = video.viewCountText || video.second__viewCountText
if views
= ` • `
span.views= views
if video.publishedText
= ` • `
span.published= video.publishedText
if video.descriptionHtml
div.description!= video.descriptionHtml