This repository was archived by the owner on May 13, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-14
lines changed Expand file tree Collapse file tree 1 file changed +13
-14
lines changed Original file line number Diff line number Diff line change 11<template >
2- <a
3- v-if =" getFirstEnabledFeed"
4- class =" feed"
5- :href =" getFirstEnabledFeed | getFeedFilePath"
6- >
2+ <a v-if =" firstEnabledFeed" class =" feed" :href =" feedFilePath" >
73 <RssIcon />
84 </a >
95</template >
@@ -13,22 +9,25 @@ import { RssIcon } from 'vue-feather-icons'
139
1410export default {
1511 components: { RssIcon },
16- filters: {
17- getFeedFilePath (feed ) {
18- if (feed === ' rss' ) return ' /rss.xml'
19- if (feed === ' atom' ) return ' /feed.atom'
20- if (feed === ' json' ) return ' /feed.json'
21- return ' '
22- },
23- },
12+
2413 computed: {
25- getFirstEnabledFeed () {
14+ firstEnabledFeed () {
2615 for (const feed in this .$service .feed ) {
2716 const isEnabled = this .$service .feed [feed]
2817 if (isEnabled) return feed
2918 }
3019 return false
3120 },
21+ feedFilePath () {
22+ if (! this .firstEnabledFeed ) return
23+
24+ let path = ' '
25+ if (this .firstEnabledFeed === ' rss' ) path = ' /rss.xml'
26+ if (this .firstEnabledFeed === ' atom' ) path = ' /feed.atom'
27+ if (this .firstEnabledFeed === ' json' ) path = ' /feed.json'
28+
29+ return this .$withBase (path)
30+ },
3231 },
3332}
3433 </script >
You can’t perform that action at this time.
0 commit comments