From 5f3089a49cdde3f5d785e42f28cbb08375012974 Mon Sep 17 00:00:00 2001 From: ParkWonYeop Date: Sun, 28 Dec 2025 02:11:33 +0900 Subject: [PATCH] . --- public/robot.txt | 3 --- src/app/robots.ts | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) delete mode 100644 public/robot.txt create mode 100644 src/app/robots.ts diff --git a/public/robot.txt b/public/robot.txt deleted file mode 100644 index 75cf363..0000000 --- a/public/robot.txt +++ /dev/null @@ -1,3 +0,0 @@ -User-agent: * -Allow: / -Sitemap: https://blog.wypark.me/sitemap.xml \ No newline at end of file diff --git a/src/app/robots.ts b/src/app/robots.ts new file mode 100644 index 0000000..53dc2e0 --- /dev/null +++ b/src/app/robots.ts @@ -0,0 +1,16 @@ +import { MetadataRoute } from 'next'; + +export default function robots(): MetadataRoute.Robots { + const baseUrl = 'https://blog.wypark.me'; + + return { + rules: { + userAgent: '*', + allow: '/', + // 검색 로봇이 굳이 긁어갈 필요 없는 페이지들은 차단 (글쓰기, 로그인 등) + disallow: ['/write', '/login', '/signup', '/admin'], + }, + // 여기서 동적으로 생성된 sitemap.xml을 가리킵니다. + sitemap: `${baseUrl}/sitemap.xml`, + }; +} \ No newline at end of file