refactoring tags page / controller

This commit is contained in:
lesion
2022-06-18 01:07:43 +02:00
parent 44ed5881cc
commit e021ec56ba
2 changed files with 42 additions and 15 deletions

View File

@@ -11,11 +11,24 @@
</template>
<script>
import { mapState } from 'vuex'
import Event from '@/components/Event'
export default {
name: 'Tag',
components: { Event },
head ({ $route }) {
const tag = $route.params.tag
const title = `${this.settings.title} #${tag}`
return {
title,
link: [
{ rel: 'alternate', type: 'application/rss+xml', title, href: this.settings.baseurl + `/feed/rss/tag/${tag}` },
{ rel: 'alternate', type: 'text/calendar', title, href: this.settings.baseurl + `/feed/ics/tag/${tag}` }
]
}
},
computed: mapState(['settings']),
async asyncData ({ $axios, params, error }) {
try {
const tag = params.tag