feat: 🔍 Block all AI crawlers in robots.txt, make users who opt out of indexing not-indexable

This commit is contained in:
Jesse Wierzbinski 2024-06-20 20:01:33 -10:00
parent e74dbe3d59
commit 6c43374d8e
No known key found for this signature in database
4 changed files with 39 additions and 0 deletions

24
assets/robots.txt Normal file
View file

@ -0,0 +1,24 @@
User-agent: AdsBot-Google
User-agent: Amazonbot
User-agent: anthropic-ai
User-agent: Applebot-Extended
User-agent: Bytespider
User-agent: CCBot
User-agent: ChatGPT-User
User-agent: ClaudeBot
User-agent: Claude-Web
User-agent: cohere-ai
User-agent: Diffbot
User-agent: FacebookBot
User-agent: FriendlyCrawler
User-agent: Google-Extended
User-agent: GoogleOther
User-agent: GPTBot
User-agent: img2dataset
User-agent: omgili
User-agent: omgilibot
User-agent: peer39_crawler
User-agent: peer39_crawler/1.0
User-agent: PerplexityBot
User-agent: YouBot
Disallow: /

View file

@ -597,6 +597,9 @@ export default defineNuxtConfig({
ogImage: { ogImage: {
enabled: false, enabled: false,
}, },
robots: {
blockNonSeoBots: true,
},
veeValidate: { veeValidate: {
autoImports: true, autoImports: true,
componentNames: { componentNames: {

View file

@ -54,5 +54,11 @@ useServerSeoMeta({
title: note.value?.account.display_name, title: note.value?.account.display_name,
description: note.value?.content, description: note.value?.content,
ogImage: note.value?.media_attachments[0]?.preview_url, ogImage: note.value?.media_attachments[0]?.preview_url,
robots: computed(() => ({
noindex: !!note.value?.account.noindex,
nofollow: !!note.value?.account.noindex,
noarchive: !!note.value?.account.noindex,
noimageindex: !!note.value?.account.noindex,
})),
}); });
</script> </script>

View file

@ -56,5 +56,11 @@ useServerSeoMeta({
description: computed(() => description: computed(() =>
account.value ? account.value.note : undefined, account.value ? account.value.note : undefined,
), ),
robots: computed(() => ({
noindex: !!account.value?.noindex,
nofollow: !!account.value?.noindex,
noarchive: !!account.value?.noindex,
noimageindex: !!account.value?.noindex,
})),
}); });
</script> </script>