docs: generate open graph images for all pages
This commit is contained in:
@@ -31,7 +31,7 @@ export default {
|
||||
},
|
||||
{
|
||||
property: 'og:image',
|
||||
content: 'https://next.tiptap.dev/og-image.png',
|
||||
content: this.getOpenGraphImage(),
|
||||
},
|
||||
/* Twitter */
|
||||
{
|
||||
@@ -44,7 +44,7 @@ export default {
|
||||
},
|
||||
{
|
||||
name: 'twitter:image',
|
||||
content: 'https://next.tiptap.dev/og-image.png',
|
||||
content: this.getOpenGraphImage(),
|
||||
},
|
||||
{
|
||||
name: 'twitter:site',
|
||||
@@ -53,6 +53,15 @@ export default {
|
||||
],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getOpenGraphImage() {
|
||||
const path = this.$route.path.replace(/\/$/, '')
|
||||
|
||||
return path === ''
|
||||
? 'https://next.tiptap.dev/og-image.png'
|
||||
: `/images${path}/og-image.png`
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user