Skip to content
This repository has been archived by the owner on Jun 13, 2022. It is now read-only.

Commit

Permalink
fix(core): add the Atom & RSS feeds alternate meta links
Browse files Browse the repository at this point in the history
  • Loading branch information
juliomrqz committed Dec 11, 2018
1 parent 34c03a2 commit fcffb67
Showing 1 changed file with 33 additions and 3 deletions.
36 changes: 33 additions & 3 deletions packages/@statusfy/core/client/components/mixins/head.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default {
head () {
head() {
const favicons = this.$statusfy.iconSizes.map(size => {
return {
hid: `favicon-${size}`,
Expand All @@ -11,11 +11,41 @@ export default {

const canonical = `${this.$statusfy.baseUrl}${this.$route.path}`

// Atom and RSS
let linksFeeds = []
if (this.$statusfy.notifications && this.$statusfy.notifications.feeds) {
const feedsBaseUrl = this.$statusfy.baseUrl === '/'
? '/feeds'
: `${this.$statusfy.baseUrl}/feeds`

linksFeeds = [{
rel: 'alternate',
type: 'application/rss+xml',
hid: 'alternate-feed-rss',
title: '',
href: `${feedsBaseUrl}/incidents.${this.$i18n.locale}.xml`
},
{
rel: 'alternate',
type: 'application/atom+xml',
hid: 'alternate-feed-atom',
title: '',
href: `${feedsBaseUrl}/incidents.${this.$i18n.locale}.atom`,
},
]
}

return {
link: [
...favicons,
{ rel: 'canonical', href: canonical, hid: 'canonical' }
]
...linksFeeds,
{
rel: 'canonical',
href: canonical,
hid: 'canonical'
},
],

}
}
}

0 comments on commit fcffb67

Please sign in to comment.