KIM-JINO5 2 месяцев назад
Родитель
Сommit
b6ca2ea2f3
4 измененных файлов с 74 добавлено и 1 удалено
  1. 5 1
      app/layout.tsx
  2. 24 0
      app/robots.ts
  3. 37 0
      app/sitemap.ts
  4. 8 0
      public/manifest.json

+ 5 - 1
app/layout.tsx

@@ -30,7 +30,10 @@ export async function generateMetadata(): Promise<Metadata> {
         authors: config?.meta?.author ? [{ name: config.meta.author }] : undefined,
         applicationName: config?.meta.applicationName,
         generator: config?.meta.generator,
-        robots: config?.meta.robots
+        robots: config?.meta.robots,
+        other: {
+            'naver-site-verification': '18dc0d1c5cb466a765e5f5093f94638ed6537d1c',
+        },
     };
 }
 
@@ -48,6 +51,7 @@ export default async function RootLayout({
     return (
         <html lang="ko">
             <head>
+                <link rel="manifest" href="/manifest.json" />
                 <Script src="https://www.googletagmanager.com/gtag/js?id=G-DY6YFW4CTM" strategy="afterInteractive" />
                 <Script id="gtag-init" strategy="afterInteractive">
                     {`

+ 24 - 0
app/robots.ts

@@ -0,0 +1,24 @@
+import { MetadataRoute } from 'next';
+
+export default function robots(): MetadataRoute.Robots {
+	return {
+		rules: {
+			userAgent: '*',
+			allow: '/',
+			disallow: [
+				'/api/',
+				'/profile/',
+				'/change-',
+				'/my-posts/',
+				'/my-comments/',
+				'/login-log/',
+				'/exp-logs/',
+				'/withdraw/',
+				'/verify-email/',
+				'/post/write/',
+				'/post/edit/',
+			],
+		},
+		sitemap: 'https://bitforum.io/sitemap.xml',
+	};
+}

+ 37 - 0
app/sitemap.ts

@@ -0,0 +1,37 @@
+import { MetadataRoute } from 'next';
+import { fetchBoardList } from '@/lib/api/forum/board';
+
+const BASE_URL = 'https://bitforum.io';
+
+export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
+	// 정적 페이지
+	const staticPages: MetadataRoute.Sitemap = [
+		{ url: BASE_URL, changeFrequency: 'daily', priority: 1.0 },
+		{ url: `${BASE_URL}/login`, changeFrequency: 'monthly', priority: 0.3 },
+		{ url: `${BASE_URL}/register`, changeFrequency: 'monthly', priority: 0.3 },
+		{ url: `${BASE_URL}/news`, changeFrequency: 'daily', priority: 0.7 },
+		{ url: `${BASE_URL}/docs`, changeFrequency: 'weekly', priority: 0.5 },
+		{ url: `${BASE_URL}/support/faq`, changeFrequency: 'monthly', priority: 0.4 },
+		{ url: `${BASE_URL}/support/guide`, changeFrequency: 'monthly', priority: 0.4 },
+		{ url: `${BASE_URL}/support/contact`, changeFrequency: 'monthly', priority: 0.3 },
+	];
+
+	// 동적: 게시판 목록
+	let boardPages: MetadataRoute.Sitemap = [];
+	try {
+		const res = await fetchBoardList();
+		if (res.success && res.data?.list) {
+			boardPages = res.data.list
+				.filter(b => b.isActive)
+				.map(b => ({
+					url: `${BASE_URL}/board/${b.code}`,
+					changeFrequency: 'daily' as const,
+					priority: 0.8,
+				}));
+		}
+	} catch {
+
+	}
+
+	return [...staticPages, ...boardPages];
+}

+ 8 - 0
public/manifest.json

@@ -0,0 +1,8 @@
+{
+	"name": "bitforum",
+	"short_name": "bitforum",
+	"start_url": "/",
+	"display": "standalone",
+	"background_color": "#ffffff",
+	"theme_color": "#000000"
+}