diff --git a/client/app.vue b/client/app.vue index cdbe80b..8762056 100644 --- a/client/app.vue +++ b/client/app.vue @@ -44,10 +44,14 @@ export default { components: {}, setup() { + const config = useRuntimeConfig() useOpnSeoMeta({ title: 'OpnForm', description: 'Create beautiful forms for free. Unlimited fields, unlimited submissions. It\'s free and it takes less than 1 minute to create your first form.', ogImage: '/img/social-preview.jpg', + robots: () => { + return config.public.env === 'production' ? null : 'noindex, nofollow' + } }) useHead({ titleTemplate: (titleChunk) => { diff --git a/client/pages/forms/[slug]/index.vue b/client/pages/forms/[slug]/index.vue index 6fd6770..920c03d 100644 --- a/client/pages/forms/[slug]/index.vue +++ b/client/pages/forms/[slug]/index.vue @@ -132,7 +132,7 @@ useOpnSeoMeta({ } return (form && form.value.cover_picture) ? form.value.cover_picture : null }, - robots () { + robots: () => { return (form && form.value.can_be_indexed) ? null : 'noindex, nofollow' } }) diff --git a/client/pages/templates/[slug].vue b/client/pages/templates/[slug].vue index 8936240..37e85d9 100644 --- a/client/pages/templates/[slug].vue +++ b/client/pages/templates/[slug].vue @@ -275,7 +275,7 @@ useOpnSeoMeta({ if (!template || !template.value) return null return template.value.image_url }, - robots() { + robots: () => { if (!template || !template.value) return null return template.value.publicly_listed ? null : 'noindex' }