Skip to content

Commit

Permalink
feat: dynamic title and description derived from tags and domain
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAkbal committed Feb 22, 2021
1 parent fd0e3fe commit 8a88247
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions components/pages/posts/navigation/url/UrlManagerMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@ import { mapGetters, mapActions } from 'vuex'
import { isEqual } from 'lodash-es'

export default {
head() {
const tags = this.urlTags?.split(',').join(', ')

return {
title: tags || 'Posts',

meta: [
{
hid: 'description',
name: 'description',
content: `Rule 34 of ${tags} on ${this.urlDomain}.`,
},
],
}
},

computed: {
...mapGetters('url', ['urlDomain', 'urlPage', 'urlTags']),
},
Expand Down

0 comments on commit 8a88247

Please sign in to comment.