it-tools/components/Tool.vue

34 lines
794 B
Vue
Raw Normal View History

2021-02-06 11:14:28 +01:00
<script lang="ts">
2021-05-28 19:44:27 +02:00
import {Component, mixins} from 'nuxt-property-decorator'
2021-02-13 19:55:45 +01:00
import ToolWrapper from '~/components/ToolWrapper.vue'
2021-05-28 19:44:27 +02:00
import {ToolConfigMixin} from '~/mixins/tool-config.mixin'
2021-05-28 19:44:27 +02:00
@Component({
components: {ToolWrapper}
})
export default class Tool extends mixins(ToolConfigMixin) {
2021-02-06 11:14:28 +01:00
public head() {
2021-05-28 19:44:27 +02:00
const {title, description, keywords} = this.$toolConfig
2021-02-06 11:14:28 +01:00
2021-05-17 21:18:35 +02:00
const uniqueKeywordsCleaned = [...new Set([...keywords, ...title.split(/\s+/)].map(s => s.trim().toLowerCase()))]
2021-02-06 11:14:28 +01:00
return {
title,
2021-02-13 19:55:45 +01:00
meta: [
{
name: 'description',
2021-03-15 17:38:50 +01:00
content: description,
hid: 'description'
2021-02-13 19:55:45 +01:00
},
{
name: 'keywords',
2021-05-17 21:18:35 +02:00
content: uniqueKeywordsCleaned,
2021-03-15 17:38:50 +01:00
hid: 'keywords'
2021-02-13 19:55:45 +01:00
}
]
2021-02-06 11:14:28 +01:00
}
}
}
</script>