fix #23, add feed links in pages

This commit is contained in:
les
2019-09-17 18:16:59 +02:00
parent 46bc1854de
commit f08273aa10
6 changed files with 28 additions and 11 deletions

View File

@@ -73,6 +73,10 @@ export default {
head () {
if (!this.event) { return {} }
const tags_feed = this.event.tags.map(tag => ({ rel: 'alternate', type: 'application/rss+xml',
title: `${this.settings.title} events tagged ${tag.tag}`, href: this.settings.baseurl + `/feed/rss?tags=${tag.tag}` }))
const place_feed = { rel: 'alternate', type: 'application/rss+xml',
title: `${this.settings.title} events @${this.event.place.name}`, href: this.settings.baseurl + `/feed/rss?places=${this.event.placeId}` }
return {
title: `${this.settings.title} - ${this.event.title}`,
meta: [
@@ -87,7 +91,12 @@ export default {
{ hid: 'og-url', property: 'og:url', content: `event/${this.event.id}` },
{ property: 'og:type', content: 'event' },
{ property: 'og:image', content: this.imgPath }
]
],
link: [
{ rel: 'alternate', type: 'application/rss+xml', title: this.settings.title, href: this.settings.baseurl + '/feed/rss' },
...tags_feed,
place_feed
]
}
},
async asyncData ({ $axios, params, error }) {

View File

@@ -19,7 +19,7 @@
//- el-input.mt-2(v-model='notification.email' :placeholder="$t('export.insert_your_address')" ref='email')
//- el-button.mt-2.float-right(native-type= 'submit' type='success' @click='add_notification') {{$t('common.send')}}
el-tab-pane.pt-1(label='feed rss' name='feed')
el-tab-pane.pt-1(label='feed rss' name='rss')
span(v-html='$t(`export.feed_description`)')
el-input(v-model='link')
el-button(slot='append' plain
@@ -73,7 +73,7 @@ export default {
},
data () {
return {
type: 'feed',
type: 'rss',
notification: { email: '' },
list: { title: 'Gancio' }
}
@@ -128,10 +128,10 @@ export default {
}
}
return `${this.settings.baseurl}/api/export/${this.type}${query}`
return `${this.settings.baseurl}/feed/${this.type}${query}`
},
showLink () {
return (['feed', 'ics'].includes(this.type))
return (['rss', 'ics'].includes(this.type))
}
}
}