Skip to content

Beautiful Open-Source Form Builder

No follow for non-production env

Julien Nahumb29cdf8d8a73
diff --git a/client/app.vue b/client/app.vue
index cdbe80b78..8762056cc 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 6fd677068..920c03dad 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 8936240ca..37e85d968 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'
}