diff --git a/src/app/feed/hottest/route.tsx b/src/app/feed/hottest/route.ts similarity index 100% rename from src/app/feed/hottest/route.tsx rename to src/app/feed/hottest/route.ts diff --git a/src/app/feed/latest/route.tsx b/src/app/feed/latest/route.ts similarity index 100% rename from src/app/feed/latest/route.tsx rename to src/app/feed/latest/route.ts diff --git a/src/app/robots.ts b/src/app/robots.ts new file mode 100644 index 00000000..5a741fd4 --- /dev/null +++ b/src/app/robots.ts @@ -0,0 +1,11 @@ +import { MetadataRoute } from "next" + +export default function robots(): MetadataRoute.Robots { + return { + rules: { + userAgent: "*", + allow: "/", + disallow: ["/dashboard/", "/preview/", "/api/"], + }, + } +} diff --git a/src/middleware.ts b/src/middleware.ts index ea12dd5a..efc06eec 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -53,7 +53,9 @@ export default async function middleware(req: NextRequest) { pathname.startsWith("/locales/") || pathname.match(/^\/(workbox|worker|fallback)-\w+\.js(\.map)?$/) || pathname === "/sw.js" || - pathname === "/sw.js.map" + pathname === "/sw.js.map" || + pathname === "/robots.txt" || + pathname === "/sitemap.xml" ) { return NextResponse.next() }