feat(seo): removed duplicate keywords and added split title
This commit is contained in:
		
							parent
							
								
									4fdc09a787
								
							
						
					
					
						commit
						34800f461d
					
				| @ -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…
	
		Reference in New Issue
	
	Block a user