diff --git a/src/app/create-username/page.tsx b/src/app/create-username/page.tsx index b7eab72..b6aa63d 100644 --- a/src/app/create-username/page.tsx +++ b/src/app/create-username/page.tsx @@ -6,6 +6,10 @@ import UsernameForm from "@/components/username-form"; export const metadata: Metadata = { title: "Create your Username - TomodachiShare", description: "Pick a unique username to start using TomodachiShare", + robots: { + index: false, + follow: false, + }, }; export default async function CreateUsernamePage() { diff --git a/src/app/edit/[slug]/page.tsx b/src/app/edit/[slug]/page.tsx index 0e553f9..efe67d6 100644 --- a/src/app/edit/[slug]/page.tsx +++ b/src/app/edit/[slug]/page.tsx @@ -21,6 +21,10 @@ export async function generateMetadata({ params }: Props): Promise { return { title: `${mii?.name} - TomodachiShare`, description: `Edit the name, tags, and images of '${mii?.name}'`, + robots: { + index: false, + follow: false, + }, }; } diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 693e333..c29e588 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -15,6 +15,10 @@ const lexend = Lexend({ export const metadata: Metadata = { title: "TomodachiShare", description: "Discover and share Mii residents for your Tomodachi Life island!", + robots: { + index: true, + follow: true, + }, }; export default function RootLayout({ diff --git a/src/app/mii/[slug]/page.tsx b/src/app/mii/[slug]/page.tsx index a92d40a..d74674a 100644 --- a/src/app/mii/[slug]/page.tsx +++ b/src/app/mii/[slug]/page.tsx @@ -68,10 +68,6 @@ export async function generateMetadata({ params }: Props): Promise { alternates: { canonical: `/mii/${mii.id}`, }, - robots: { - index: true, - follow: true, - }, }; } diff --git a/src/app/profile/[slug]/page.tsx b/src/app/profile/[slug]/page.tsx index 784a3d1..1ac5069 100644 --- a/src/app/profile/[slug]/page.tsx +++ b/src/app/profile/[slug]/page.tsx @@ -63,10 +63,6 @@ export async function generateMetadata({ params }: Props): Promise { alternates: { canonical: `/profile/${user.id}`, }, - robots: { - index: true, - follow: true, - }, }; } diff --git a/src/app/profile/settings/page.tsx b/src/app/profile/settings/page.tsx index 603e261..d36b6fe 100644 --- a/src/app/profile/settings/page.tsx +++ b/src/app/profile/settings/page.tsx @@ -13,6 +13,10 @@ import ProfileSettings from "@/components/profile-settings"; export const metadata: Metadata = { title: "Profile Settings - TomodachiShare", description: "Change your account info or delete it", + robots: { + index: false, + follow: false, + }, }; export default async function ProfileSettingsPage() { diff --git a/src/app/robots.ts b/src/app/robots.ts new file mode 100644 index 0000000..dd57361 --- /dev/null +++ b/src/app/robots.ts @@ -0,0 +1,12 @@ +import type { MetadataRoute } from "next"; + +export default function robots(): MetadataRoute.Robots { + return { + rules: { + userAgent: "*", + allow: "/", + disallow: ["/create-username", "/edit/*", "/profile/settings", "/random", "/submit"], + }, + sitemap: `${process.env.BASE_URL}/sitemap.xml`, + }; +} diff --git a/src/app/submit/page.tsx b/src/app/submit/page.tsx index 2b3bee2..b1596d4 100644 --- a/src/app/submit/page.tsx +++ b/src/app/submit/page.tsx @@ -6,6 +6,10 @@ import SubmitForm from "@/components/submit-form"; export const metadata: Metadata = { title: "Submit a Mii - TomodachiShare", description: "Upload your Tomodachi Life Mii through its QR code and share it with others", + robots: { + index: false, + follow: false, + }, }; export default async function SubmitPage() {