|
|
@@ -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
|
},
|