|
|
@@ -116,28 +116,28 @@ export default {
|
|
116
|
116
|
const page = this.allPages.filter(
|
|
117
|
117
|
page => page.slug == type + 's',
|
|
118
|
118
|
)[0]
|
|
119
|
|
- const blankHero = { url: null, heroType: null }
|
|
|
119
|
+ let hero = { url: null, heroType: null }
|
|
|
120
|
+
|
|
120
|
121
|
// Clear the hero and bail
|
|
121
|
|
- if(!page) return this.$store.commit('SET_HERO', blankHero)
|
|
|
122
|
+ if(!page) return this.$store.commit('SET_HERO', hero)
|
|
122
|
123
|
|
|
123
|
|
- blankHero.url = page.featured
|
|
124
|
|
- blankHero.heroType = 'image'
|
|
125
|
|
- let json = hero = blankHero
|
|
|
124
|
+ hero.url = page.featured
|
|
|
125
|
+ hero.heroType = 'image'
|
|
126
|
126
|
if (
|
|
127
|
127
|
page.hero &&
|
|
128
|
128
|
JSON.parse(page.hero) &&
|
|
129
|
129
|
JSON.parse(page.hero).url
|
|
130
|
130
|
) {
|
|
131
|
|
- json = JSON.parse(page.hero)
|
|
132
|
|
- json.heroType = 'video'
|
|
|
131
|
+ hero = JSON.parse(page.hero)
|
|
|
132
|
+ hero.heroType = 'video'
|
|
133
|
133
|
}
|
|
134
|
134
|
// No featured or youTube
|
|
135
|
|
- if (!json.url) {
|
|
136
|
|
- json.heroType = null
|
|
|
135
|
+ if (!hero.url) {
|
|
|
136
|
+ hero.heroType = null
|
|
137
|
137
|
}
|
|
138
|
138
|
// Set the hero text to the post title or excerpt
|
|
139
|
|
- json.text = page && page.excerpt ? page.excerpt : page.title
|
|
140
|
|
- this.$store.commit('SET_HERO', json)
|
|
|
139
|
+ hero.text = page && page.excerpt ? page.excerpt : page.title
|
|
|
140
|
+ this.$store.commit('SET_HERO', hero)
|
|
141
|
141
|
},
|
|
142
|
142
|
scrollTo(hashtag) {
|
|
143
|
143
|
setTimeout(() => {
|