feat: robots.txt app router
This commit is contained in:
parent
3eb0594ac1
commit
778d685cb0
|
|
@ -0,0 +1,11 @@
|
|||
import { MetadataRoute } from "next"
|
||||
|
||||
export default function robots(): MetadataRoute.Robots {
|
||||
return {
|
||||
rules: {
|
||||
userAgent: "*",
|
||||
allow: "/",
|
||||
disallow: ["/dashboard/", "/preview/", "/api/"],
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
@ -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()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue