Better SEO form previews (#61)

This commit is contained in:
Chirag
2023-01-05 19:46:06 +05:30
committed by GitHub
parent 9783b07778
commit 5486768125
2 changed files with 16 additions and 1 deletions

View File

@@ -46,6 +46,7 @@ import { mapState } from 'vuex'
import OpenCompleteForm from '../../components/open/forms/OpenCompleteForm'
import Cookies from 'js-cookie'
import sha256 from 'js-sha256'
import SeoMeta from '../../mixins/seo-meta'
const isFrame = window.location !== window.parent.location || window.frameElement
@@ -106,6 +107,7 @@ function loadForm (slug) {
export default {
components: { OpenCompleteForm },
mixins: [SeoMeta],
beforeRouteEnter (to, from, next) {
if (window.$crisp) {
@@ -172,6 +174,12 @@ export default {
metaTitle () {
return this.form ? this.form.title : 'Create beautiful forms'
},
metaDescription () {
return (this.form && this.form.description) ? this.form.description.substring(0,160) : null
},
metaImage () {
return (this.form && this.form.cover_picture) ? this.form.cover_picture : null
},
metaTags () {
return (this.form && this.form.can_be_indexed) ? [] : [{ name: 'robots', content: 'noindex' }]
}