Bläddra i källkod

:recycle: defaulting to titles in the hero

tags/0.9.0
j 4 år sedan
förälder
incheckning
59de146290

+ 1
- 1
vue-theme/src/components/hero.vue Visa fil

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

+ 2
- 2
vue-theme/src/components/sidebars/exhibitions.vue Visa fil

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

+ 9
- 5
vue-theme/src/pages/list.vue Visa fil

96
             const page = this.allPages[type]
96
             const page = this.allPages[type]
97
             if(!page) return
97
             if(!page) return
98
             
98
             
99
-            let json = { url: page.featured, heroType: 'image' }
99
+            const json = { url: page.featured, heroType: 'image' }
100
             if(page.hero && JSON.parse(page.hero) && JSON.parse(page.hero).url) {
100
             if(page.hero && JSON.parse(page.hero) && JSON.parse(page.hero).url) {
101
                 json = JSON.parse(page.hero)
101
                 json = JSON.parse(page.hero)
102
                 json.heroType = 'video'
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
             this.$store.commit('SET_HERO', json)
111
             this.$store.commit('SET_HERO', json)
108
         },
112
         },
109
     },
113
     },
113
             let type = convertTitleCase(this.type)
117
             let type = convertTitleCase(this.type)
114
             let sort = this.sortBy ? this.sortBy : to.path.split('/').pop()
118
             let sort = this.sortBy ? this.sortBy : to.path.split('/').pop()
115
             this.checkAndSetHero(this.type)
119
             this.checkAndSetHero(this.type)
116
-            console.log('---')
117
-            console.log(sort)
120
+            // console.log('---')
121
+            // console.log(sort)
118
             if(!this[`all${type}Loaded`] || sort) this.getPosts()
122
             if(!this[`all${type}Loaded`] || sort) this.getPosts()
119
         }
123
         }
120
     },
124
     },

Laddar…
Avbryt
Spara