No follow for non-production env

This commit is contained in:
Julien Nahum 2024-01-12 15:59:01 +01:00
parent ea7041be28
commit b29cdf8d8a
3 changed files with 6 additions and 2 deletions

View File

@ -44,10 +44,14 @@ export default {
components: {}, components: {},
setup() { setup() {
const config = useRuntimeConfig()
useOpnSeoMeta({ useOpnSeoMeta({
title: 'OpnForm', 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.', 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', ogImage: '/img/social-preview.jpg',
robots: () => {
return config.public.env === 'production' ? null : 'noindex, nofollow'
}
}) })
useHead({ useHead({
titleTemplate: (titleChunk) => { titleTemplate: (titleChunk) => {

View File

@ -132,7 +132,7 @@ useOpnSeoMeta({
} }
return (form && form.value.cover_picture) ? form.value.cover_picture : null return (form && form.value.cover_picture) ? form.value.cover_picture : null
}, },
robots () { robots: () => {
return (form && form.value.can_be_indexed) ? null : 'noindex, nofollow' return (form && form.value.can_be_indexed) ? null : 'noindex, nofollow'
} }
}) })

View File

@ -275,7 +275,7 @@ useOpnSeoMeta({
if (!template || !template.value) return null if (!template || !template.value) return null
return template.value.image_url return template.value.image_url
}, },
robots() { robots: () => {
if (!template || !template.value) return null if (!template || !template.value) return null
return template.value.publicly_listed ? null : 'noindex' return template.value.publicly_listed ? null : 'noindex'
} }