|
|
@@ -9,7 +9,11 @@
|
|
9
|
9
|
.posts(:class="{ 'is-grid': grid }")
|
|
10
|
10
|
section(v-for="post in posts" :key="post.slug").shadow.post
|
|
11
|
11
|
router-link(:to="`/${type}/${post.slug}`")
|
|
12
|
|
- p {{ post.featured }}
|
|
|
12
|
+ p(v-if="post.featured") {{ post.featured }}
|
|
|
13
|
+ img(v-else-if="JSON.parse(post.hero).url" :src="getThumbnailFromYt(JSON.parse(post.hero).url)" alt="YouTube")
|
|
|
14
|
+ p(v-else-if="post.hero") {{ post.hero }}
|
|
|
15
|
+ p(v-else) ERROR: no thumbnail
|
|
|
16
|
+
|
|
13
|
17
|
h4 {{ post.title }}
|
|
14
|
18
|
p(style="font-size: 9px;") {{ post.date }}
|
|
15
|
19
|
|
|
|
@@ -29,7 +33,7 @@
|
|
29
|
33
|
import sidebar from '@/components/sidebars/sidebar'
|
|
30
|
34
|
import { postTypeGetters, scrollTop } from './mixin-post-types'
|
|
31
|
35
|
|
|
32
|
|
-import { convertTitleCase, typeFromRoute, sortTypes } from '@/utils/helpers'
|
|
|
36
|
+import { convertTitleCase, typeFromRoute, sortTypes, ytThumbnail } from '@/utils/helpers'
|
|
33
|
37
|
|
|
34
|
38
|
export default {
|
|
35
|
39
|
components: { sidebar },
|
|
|
@@ -68,6 +72,9 @@ export default {
|
|
68
|
72
|
},
|
|
69
|
73
|
},
|
|
70
|
74
|
methods: {
|
|
|
75
|
+ getThumbnailFromYt(url) {
|
|
|
76
|
+ return ytThumbnail(url, 'medium')
|
|
|
77
|
+ },
|
|
71
|
78
|
setHeroAndGetPosts() {
|
|
72
|
79
|
let type = convertTitleCase(this.type)
|
|
73
|
80
|
|