mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Add related videos to game template
This commit is contained in:
parent
83889f1b63
commit
63c9f10b86
1 changed files with 34 additions and 22 deletions
|
|
@ -10,6 +10,19 @@
|
|||
|
||||
<ThomasCredit />
|
||||
|
||||
|
||||
<div
|
||||
v-if="relatedVideos.length !== 0"
|
||||
class="related-videos w-full"
|
||||
>
|
||||
<h2 class="subtitle text-xl md:text-2xl font-bold mb-3">
|
||||
Related Videos
|
||||
</h2>
|
||||
<VideoRow
|
||||
:videos="relatedVideos"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<h2 class="subtitle text-xl md:text-2xl font-bold py-6">
|
||||
Reports
|
||||
</h2>
|
||||
|
|
@ -44,7 +57,7 @@
|
|||
</div>
|
||||
|
||||
<div
|
||||
v-if="report['Source'].length !== 0"
|
||||
v-if="report['Source'].includes('https://')"
|
||||
class="border-t border-gray-200"
|
||||
>
|
||||
<div class="-mt-px flex">
|
||||
|
|
@ -86,39 +99,38 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import VideoRow from '~/components/video/row.vue'
|
||||
import LinkButton from '~/components/link-button.vue'
|
||||
import ThomasCredit from '~/components/thomas-credit.vue'
|
||||
|
||||
import gameList from '~/static/game-list.json'
|
||||
|
||||
// import buildAppList from '~/helpers/build-app-list'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
VideoRow,
|
||||
LinkButton,
|
||||
ThomasCredit
|
||||
},
|
||||
async asyncData ({ params: { slug } }) {
|
||||
|
||||
const { default: gameList } = await import('~/static/game-list.json')
|
||||
const { default: videoList } = await import('~/static/video-list.json')
|
||||
const { videosRelatedToApp } = await import('~/helpers/related.js')
|
||||
|
||||
const app = gameList.find(app => (app.slug === slug))
|
||||
|
||||
const relatedVideos = videosRelatedToApp(app)
|
||||
|
||||
// Find other videos that also feature this video's app
|
||||
// for (const video of videoList) {
|
||||
// if (!video.apps.includes(app.slug)) continue
|
||||
|
||||
// relatedVideos.push(video)
|
||||
// }
|
||||
|
||||
return {
|
||||
slug,
|
||||
app: gameList.find(app => (app.slug === slug))
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
affiliateLinks () {
|
||||
return [
|
||||
{
|
||||
label: 'View on Humble Bundle',
|
||||
subLabel: 'Supports Charity',
|
||||
href: `https://www.humblebundle.com/store/search?sort=bestselling&partner=doesitarm&charity=1693256&platform=mac&search=${this.app.name}`
|
||||
},
|
||||
// {
|
||||
// label: 'View on Humble Bundle',
|
||||
// subLabel: 'Supports Charity',
|
||||
// href: `https://www.humblebundle.com/store/search?sort=bestselling&partner=doesitarm&charity=1693256&platform=mac&search=${this.app.name}`
|
||||
// }
|
||||
]
|
||||
app,
|
||||
relatedVideos
|
||||
}
|
||||
},
|
||||
head() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue