Przeglądaj źródła

:recycle: defaulting to titles in the hero

tags/0.9.0
j 4 lat temu
rodzic
commit
59de146290

+ 1
- 1
vue-theme/src/components/hero.vue Wyświetl plik

@@ -4,7 +4,7 @@
4 4
         iframe(
5 5
             v-if="isPlaying"
6 6
             :src="`https://www.youtube.com/embed/${heroIdFromUrl}?autoplay=1`"
7
-            frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope"
7
+            frameborder="0"
8 8
             allowfullscreen
9 9
         ).embedded.w-max
10 10
         .blank.f-col(v-else)

+ 2
- 2
vue-theme/src/components/sidebars/exhibitions.vue Wyświetl plik

@@ -19,10 +19,10 @@ ul.t-up
19 19
 export default {
20 20
     props: {
21 21
         postsByType:{
22
-            required: true
22
+            type: Array
23 23
         }, 
24 24
         postType:{
25
-            required: true
25
+            type: String
26 26
         }, 
27 27
     }
28 28
 }

+ 9
- 5
vue-theme/src/pages/list.vue Wyświetl plik

@@ -96,14 +96,18 @@ export default {
96 96
             const page = this.allPages[type]
97 97
             if(!page) return
98 98
             
99
-            let json = { url: page.featured, heroType: 'image' }
99
+            const json = { url: page.featured, heroType: 'image' }
100 100
             if(page.hero && JSON.parse(page.hero) && JSON.parse(page.hero).url) {
101 101
                 json = JSON.parse(page.hero)
102 102
                 json.heroType = 'video'
103 103
             }
104
-            if(page && page.content) {
105
-                json.text = this.allPages[type].content
104
+            // No featured or youTube
105
+            if(!json.url) {
106
+                json.heroType = null
106 107
             }
108
+            // Set the hero text to the post title or excerpt
109
+            json.text = page && page.excerpt ? page.excerpt : page.title
110
+
107 111
             this.$store.commit('SET_HERO', json)
108 112
         },
109 113
     },
@@ -113,8 +117,8 @@ export default {
113 117
             let type = convertTitleCase(this.type)
114 118
             let sort = this.sortBy ? this.sortBy : to.path.split('/').pop()
115 119
             this.checkAndSetHero(this.type)
116
-            console.log('---')
117
-            console.log(sort)
120
+            // console.log('---')
121
+            // console.log(sort)
118 122
             if(!this[`all${type}Loaded`] || sort) this.getPosts()
119 123
         }
120 124
     },

Ładowanie…
Anuluj
Zapisz