mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-21 07:16:15 -04:00
feat(seo): removed duplicate keywords and added split title
This commit is contained in:
parent
4fdc09a787
commit
34800f461d
1 changed files with 4 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
||||||
import {Component, Vue} from 'nuxt-property-decorator'
|
import {Component, Vue} from 'nuxt-property-decorator'
|
||||||
import ToolWrapper from '~/components/ToolWrapper.vue'
|
import ToolWrapper from '~/components/ToolWrapper.vue'
|
||||||
import type {ToolConfig} from '~/types/ToolConfig'
|
import type {ToolConfig} from '~/types/ToolConfig'
|
||||||
|
|
||||||
@Component({components: {ToolWrapper}})
|
@Component({components: {ToolWrapper}})
|
||||||
export default class Tool extends Vue {
|
export default class Tool extends Vue {
|
||||||
config(): ToolConfig {
|
config(): ToolConfig {
|
||||||
|
@ -11,6 +12,8 @@ export default class Tool extends Vue {
|
||||||
public head() {
|
public head() {
|
||||||
const {title, description, keywords} = this.config()
|
const {title, description, keywords} = this.config()
|
||||||
|
|
||||||
|
const uniqueKeywords = [...new Set([...keywords, ...title.split(/\s+/)])]
|
||||||
|
|
||||||
return {
|
return {
|
||||||
title,
|
title,
|
||||||
meta: [
|
meta: [
|
||||||
|
@ -21,7 +24,7 @@ export default class Tool extends Vue {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'keywords',
|
name: 'keywords',
|
||||||
content: keywords,
|
content: uniqueKeywords,
|
||||||
hid: 'keywords'
|
hid: 'keywords'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue