@roottale/cms-mcp 0.35.0 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/index.js +1 -1
- package/docs/api-reference.md +14 -1
- package/docs/blog.md +38 -10
- package/docs/collections.md +58 -0
- package/docs/seo.md +62 -0
- package/examples/nextjs/app/blog/[slug]/page.tsx +9 -19
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @roottale/cms-mcp
|
|
2
2
|
|
|
3
|
+
## 0.36.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 1fe867f: 문서 갱신 — 블로그 설정 응답의 글 하단 CTA(`post_cta`)와 사이트 SEO 기본값
|
|
8
|
+
(`site_profile`: 설명·로고·파비콘·기본 OG)을 api-reference / blog 가이드에 반영.
|
|
9
|
+
CTA 는 `RootTaleBlogPost` 가 본문 끝에 자동 렌더하고, `site_profile` 은 외부
|
|
10
|
+
사이트가 head + OG 폴백으로 사용한다.
|
|
11
|
+
|
|
3
12
|
## 0.35.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
package/dist/index.js
CHANGED
|
@@ -279,7 +279,7 @@ function registerTools(server2) {
|
|
|
279
279
|
}
|
|
280
280
|
|
|
281
281
|
// src/server.ts
|
|
282
|
-
var VERSION = true ? "0.
|
|
282
|
+
var VERSION = true ? "0.36.0" : "dev";
|
|
283
283
|
var SERVER_INSTRUCTIONS = `
|
|
284
284
|
roottale-cms-mcp\uB294 RootTale CMS\uB97C \uC678\uBD80 \uC0AC\uC774\uD2B8(\uC8FC\uB85C Next.js)\uC5D0 \uC5F0\uB3D9\uD558\uAE30 \uC704\uD55C
|
|
285
285
|
\uD1B5\uD569 \uBB38\uC11C\xB7\uC608\uC2DC \uCF54\uB4DC\xB7\uACF5\uAC1C API \uC870\uD68C tool\uC744 \uC81C\uACF5\uD569\uB2C8\uB2E4.
|
package/docs/api-reference.md
CHANGED
|
@@ -113,16 +113,29 @@ fallback 네비를 렌더하세요 (`menus.md` 참고).
|
|
|
113
113
|
|
|
114
114
|
## GET /v1/cms/public/blog-settings
|
|
115
115
|
|
|
116
|
-
블로그 표시 설정 (TOC·작성자·발행일·작성자 카드, 저자
|
|
116
|
+
블로그 표시 설정 (TOC·작성자·발행일·작성자 카드, 저자 프로필, 글 하단 CTA).
|
|
117
|
+
`post_cta` 는 admin 에서 활성화하고 버튼 문구·링크를 채웠을 때만 객체이며,
|
|
118
|
+
그 외에는 `null`. `RootTaleBlogPost` 가 본문 끝에 자동으로 렌더하므로 별도
|
|
119
|
+
연동 코드는 필요 없다.
|
|
117
120
|
|
|
118
121
|
```json
|
|
119
122
|
{ "show_table_of_contents": false, "show_author": true, "show_date": true,
|
|
120
123
|
"show_author_card": true, "toc_title": null,
|
|
121
124
|
"author_profile_name": null, "author_profile_bio": null,
|
|
122
125
|
"author_profile_image_url": null, "author_profile_image_radius": "circle",
|
|
126
|
+
"site_profile": { "site_description": null, "logo_url": null,
|
|
127
|
+
"favicon_url": null, "default_og_image_url": null },
|
|
128
|
+
"post_cta": { "title": "상담이 필요하신가요?", "description": "첫 상담은 무료입니다.",
|
|
129
|
+
"button_label": "상담 문의하기", "button_href": "/contact" },
|
|
123
130
|
"updated_at": null }
|
|
124
131
|
```
|
|
125
132
|
|
|
133
|
+
`site_profile` 은 사이트 공통 SEO 값. `default_og_image_url`(1200×630 권장)은
|
|
134
|
+
글에 대표/OG 이미지가 없을 때 SNS 공유 썸네일 폴백으로 쓰세요 —
|
|
135
|
+
`generateMetadata` 에서 `post.seo?.ogImage ?? post.featured_media_url ??
|
|
136
|
+
settings.siteProfile.defaultOgImageUrl` 순으로 우선합니다. `logo_url`·
|
|
137
|
+
`favicon_url`·`site_description` 은 사이트 `<head>` 에 적용합니다.
|
|
138
|
+
|
|
126
139
|
## GET /v1/cms/public/site-knowledge
|
|
127
140
|
|
|
128
141
|
사이트 지식 — 브랜드 보이스(어조·톤·화자) + 용어 규칙(금지어·교정어). AI
|
package/docs/blog.md
CHANGED
|
@@ -38,6 +38,22 @@ export default function BlogPage() {
|
|
|
38
38
|
}
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
+
> **공지·블로그를 나눈 사이트(ADR-0060)는 목록을 반드시 섹션으로 스코프하세요.**
|
|
42
|
+
> `RootTaleBlogList` 는 기본적으로 **모든 글**을 렌더하므로, 섹션을 나눴는데
|
|
43
|
+
> `collection` 을 안 주면 공지 글이 `/blog` 목록에 섞여 나옵니다. 각 목록 페이지에서
|
|
44
|
+
> `collection`+`collections` 를 넘겨 그 섹션 글만 보이게 하세요(글 링크도 소속 섹션
|
|
45
|
+
> basePath 로 자동 라우팅). 단일 블로그 사이트는 지금처럼 안 줘도 됩니다.
|
|
46
|
+
>
|
|
47
|
+
> ```tsx
|
|
48
|
+
> import { COLLECTIONS } from "@/lib/collections"; // collections.md 참고
|
|
49
|
+
> // app/notice/page.tsx
|
|
50
|
+
> <RootTaleBlogList apiKey={apiKey} collection="notice" collections={COLLECTIONS} />
|
|
51
|
+
> // app/blog/page.tsx
|
|
52
|
+
> <RootTaleBlogList apiKey={apiKey} collection="blog" collections={COLLECTIONS} showCategoryFilter />
|
|
53
|
+
> ```
|
|
54
|
+
>
|
|
55
|
+
> 자세한 내용은 `collections.md` 참고.
|
|
56
|
+
|
|
41
57
|
### 상세 페이지
|
|
42
58
|
|
|
43
59
|
```tsx
|
|
@@ -65,7 +81,9 @@ export default async function PostPage({
|
|
|
65
81
|
```
|
|
66
82
|
|
|
67
83
|
목차(ToC)·작성자 카드·발행일 표시는 어드민의 블로그 표시 설정으로도 제어됩니다
|
|
68
|
-
(`theme-and-settings.md` 참고).
|
|
84
|
+
(`theme-and-settings.md` 참고). 어드민 설정 > 블로그에서 **글 하단 CTA**(제목·설명·
|
|
85
|
+
버튼)를 켜면 `RootTaleBlogPost` 가 모든 글 본문 끝에 같은 CTA 블록을 자동으로
|
|
86
|
+
렌더합니다 — 별도 연동 코드는 필요 없습니다.
|
|
69
87
|
|
|
70
88
|
#### 목차 블록 (본문 임의 위치)
|
|
71
89
|
|
|
@@ -147,6 +165,7 @@ export async function getPost(slug: string) {
|
|
|
147
165
|
```tsx
|
|
148
166
|
// app/blog/[slug]/page.tsx (커스텀 UI 버전)
|
|
149
167
|
import type { Metadata } from "next";
|
|
168
|
+
import { buildPostMetadata } from "@roottale/cms-renderer-next/routes";
|
|
150
169
|
import { getAllPosts, getPost } from "@/lib/blog";
|
|
151
170
|
|
|
152
171
|
export async function generateStaticParams() {
|
|
@@ -162,18 +181,27 @@ export async function generateMetadata({
|
|
|
162
181
|
const { slug } = await params;
|
|
163
182
|
const post = await getPost(slug);
|
|
164
183
|
if (!post) return {};
|
|
165
|
-
// 어드민 글 에디터의 SEO 패널
|
|
166
|
-
|
|
167
|
-
return {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
? { robots: { index: !seo?.noindex, follow: !seo?.nofollow } }
|
|
172
|
-
: {}),
|
|
173
|
-
};
|
|
184
|
+
// 어드민 글 에디터의 SEO 패널(metaJson.seo) override 적용 + self-canonical.
|
|
185
|
+
// canonical/robots/openGraph 분기를 직접 안 써도 한 곳도 빠뜨리지 않습니다.
|
|
186
|
+
return buildPostMetadata(post, {
|
|
187
|
+
siteUrl: process.env.NEXT_PUBLIC_SITE_URL,
|
|
188
|
+
path: `/blog/${post.slug}`,
|
|
189
|
+
});
|
|
174
190
|
}
|
|
175
191
|
```
|
|
176
192
|
|
|
193
|
+
`buildPostMetadata(post, opts)`는 어드민 SEO 패널 값을 Next `Metadata`로
|
|
194
|
+
한 줄 변환합니다:
|
|
195
|
+
|
|
196
|
+
- `seo.title`/`seo.description`/`seo.ogImage` 가 있으면 우선, 없으면 글 값으로 fallback
|
|
197
|
+
- `seo.canonical` override → 없으면 `siteUrl`+`path` 로 self-canonical 자동 생성
|
|
198
|
+
- `seo.noindex`/`seo.nofollow` 중 하나라도 켜지면 `robots` 출력
|
|
199
|
+
- `openGraph`(article·publishedTime·images) 자동 구성
|
|
200
|
+
|
|
201
|
+
입력은 `{ title, description?, date?, image?, seo? }` 형태면 되고
|
|
202
|
+
(`getPost` 의 `BlogPostMeta` 가 그대로 호환), 원본 post 를 쓸 땐
|
|
203
|
+
`seo: (post.metaJson as { seo?: ... }).seo` 로 넘기세요.
|
|
204
|
+
|
|
177
205
|
SEO 오버라이드 필드: `title`, `description`, `canonical`, `ogImage`,
|
|
178
206
|
`noindex`, `nofollow`.
|
|
179
207
|
|
package/docs/collections.md
CHANGED
|
@@ -152,6 +152,47 @@ export const GET = createFeedRoute({ apiKey, siteUrl, title, collections: getCol
|
|
|
152
152
|
응답은 `RouteCollection`과 구조 호환이라 그대로 넘길 수 있습니다. 매 요청 fetch를 피하려면
|
|
153
153
|
사이트 경계에서 캐시하세요(예: Next `fetch(url, { next: { revalidate: 300 } })`).
|
|
154
154
|
|
|
155
|
+
### 섹션 목록 페이지 (공지/블로그 분리 렌더)
|
|
156
|
+
|
|
157
|
+
각 섹션 목록은 `RootTaleBlogList` 에 **`collection`+`collections`** 를 넘겨 그 섹션
|
|
158
|
+
글만 보이게 합니다. **이걸 안 주면 컴포넌트가 전체 글을 렌더**하므로 공지 글이
|
|
159
|
+
`/blog` 목록에 섞여 들어옵니다(섹션을 나눈 사이트의 가장 흔한 버그). `collections`
|
|
160
|
+
를 주면 글 링크도 소속 섹션 basePath 로 자동 라우팅됩니다(공지→`/notice/{slug}`).
|
|
161
|
+
|
|
162
|
+
```tsx
|
|
163
|
+
import { RootTaleBlogList } from "@roottale/cms-renderer-next/server";
|
|
164
|
+
import { COLLECTIONS } from "@/lib/collections"; // 위 "방식 A" 의 상수
|
|
165
|
+
|
|
166
|
+
// app/notice/page.tsx — 공지 게시판
|
|
167
|
+
export default function NoticePage() {
|
|
168
|
+
return (
|
|
169
|
+
<RootTaleBlogList
|
|
170
|
+
apiKey={process.env.ROOTTALE_API_KEY!}
|
|
171
|
+
collection="notice"
|
|
172
|
+
collections={COLLECTIONS}
|
|
173
|
+
/>
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// app/blog/page.tsx — 블로그
|
|
178
|
+
export default function BlogPage() {
|
|
179
|
+
return (
|
|
180
|
+
<RootTaleBlogList
|
|
181
|
+
apiKey={process.env.ROOTTALE_API_KEY!}
|
|
182
|
+
collection="blog"
|
|
183
|
+
collections={COLLECTIONS}
|
|
184
|
+
showCategoryFilter
|
|
185
|
+
/>
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
`RootTaleBlogCategories` 도 같은 `collection`+`collections` 를 받아 그 섹션의 주제만
|
|
191
|
+
집계합니다. 카테고리 칩/사이드바를 섹션별로 나눌 때 쓰세요.
|
|
192
|
+
|
|
193
|
+
> 동적 basePath(어드민에서 자유 편집)나 catch-all 라우트를 쓰면 `collection` 값을
|
|
194
|
+
> 요청 경로에서 판정해 넘기세요(아래 "동적 basePath" 참고).
|
|
195
|
+
|
|
155
196
|
### 상세 페이지 가드 (섹션 누출 차단)
|
|
156
197
|
|
|
157
198
|
상세 라우트는 글이 그 섹션 소속인지 확인해 다른 섹션 글이 새는 것을 막습니다.
|
|
@@ -165,6 +206,23 @@ const post = await getPost(slug);
|
|
|
165
206
|
if (!post || resolvePostCollection(post, COLLECTIONS)?.key !== "blog") notFound();
|
|
166
207
|
```
|
|
167
208
|
|
|
209
|
+
### 상세 페이지 메타데이터 (canonical 공지/블로그 구분)
|
|
210
|
+
|
|
211
|
+
상세 라우트의 `generateMetadata` 도 `collections` 를 넘겨야 canonical 이 글의
|
|
212
|
+
섹션에 맞게 나옵니다. `path` 를 `/blog/...` 로 하드코딩하면 공지 글이 잘못된
|
|
213
|
+
블로그 canonical 을 갖게 됩니다.
|
|
214
|
+
|
|
215
|
+
```ts
|
|
216
|
+
import { buildPostMetadata } from "@roottale/cms-renderer-next/routes";
|
|
217
|
+
// app/blog/[slug]/page.tsx (공지면 app/notice/[slug])
|
|
218
|
+
return buildPostMetadata(post, {
|
|
219
|
+
siteUrl: process.env.NEXT_PUBLIC_SITE_URL,
|
|
220
|
+
collections: COLLECTIONS, // 글의 collectionKey 로 /notice·/blog canonical 자동 해석
|
|
221
|
+
});
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
자세한 동작은 `seo.md` 의 "글 메타데이터 → 공지·블로그 다중 스트림" 참고.
|
|
225
|
+
|
|
168
226
|
### revalidate
|
|
169
227
|
|
|
170
228
|
```ts
|
package/docs/seo.md
CHANGED
|
@@ -114,6 +114,68 @@ const crumbs = breadcrumbSchema([
|
|
|
114
114
|
발행 웹훅의 `alsoRevalidate`에 `/feed.xml`, `/sitemap.xml`을 포함해 글 변경
|
|
115
115
|
시 함께 갱신하세요 (`revalidation-webhooks.md` 참고).
|
|
116
116
|
|
|
117
|
+
## 글 메타데이터 (canonical·robots·OG)
|
|
118
|
+
|
|
119
|
+
블로그 글 상세의 `generateMetadata` 에서 어드민 SEO 패널(`metaJson.seo`) 값을
|
|
120
|
+
`buildPostMetadata` 로 한 줄 변환합니다. canonical/robots/openGraph 분기를
|
|
121
|
+
직접 쓰면 한 곳이라도 빠뜨려 SEO 가 새기 쉬운데(특히 noindex 누락·canonical
|
|
122
|
+
미설정), 이 헬퍼로 표준화합니다.
|
|
123
|
+
|
|
124
|
+
```tsx
|
|
125
|
+
// app/blog/[slug]/page.tsx
|
|
126
|
+
import type { Metadata } from "next";
|
|
127
|
+
import { buildPostMetadata } from "@roottale/cms-renderer-next/routes";
|
|
128
|
+
|
|
129
|
+
export async function generateMetadata({ params }: Props): Promise<Metadata> {
|
|
130
|
+
const { slug } = await params;
|
|
131
|
+
const post = await getPost(slug);
|
|
132
|
+
if (!post) return {};
|
|
133
|
+
return buildPostMetadata(post, {
|
|
134
|
+
siteUrl: process.env.NEXT_PUBLIC_SITE_URL, // self-canonical 기본값 origin
|
|
135
|
+
path: `/blog/${post.slug}`, // 현재 slug 기준
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
- `seo.title`/`seo.description`/`seo.ogImage` override → 없으면 글 값 fallback
|
|
141
|
+
- canonical: `seo.canonical` override → 없으면 `siteUrl`+`path` 로 **self-canonical
|
|
142
|
+
자동 생성**(모든 글이 자기 자신을 가리키는 canonical 을 갖도록 — 권장).
|
|
143
|
+
`siteUrl`/`path` 를 안 넘기면 override 가 있을 때만 canonical 출력.
|
|
144
|
+
- `seo.noindex`/`seo.nofollow` 중 하나라도 켜지면 `robots` 출력
|
|
145
|
+
- `openGraph`(type:`article`·`publishedTime`·`images`) 자동 구성
|
|
146
|
+
|
|
147
|
+
입력은 `{ title, description?, date?, image?, seo? }` 구조면 됩니다(`getPost`
|
|
148
|
+
의 `BlogPostMeta` 호환). 원본 post 를 쓸 땐 `seo: (post.metaJson as {
|
|
149
|
+
seo?: PostSeoOverrides }).seo` 로 넘기세요. `path` 는 redirect 후의 **현재
|
|
150
|
+
slug**(`post.slug`) 기준으로 주세요(아래 301 참고).
|
|
151
|
+
|
|
152
|
+
### 공지·블로그 다중 스트림 (ADR-0060)
|
|
153
|
+
|
|
154
|
+
섹션을 나눈 사이트(공지 `/notice` + 블로그 `/blog`)는 `path` 를 직접 쓰지 말고
|
|
155
|
+
**`collections` 를 넘기세요.** 글의 `collectionKey` 로 소속 섹션 basePath 를 찾아
|
|
156
|
+
canonical 을 **공지/블로그로 구분**해 해석합니다(공지 글 → `/notice/{slug}`, 블로그
|
|
157
|
+
글 → `/blog/{slug}`). `path` 를 `/blog/...` 로 하드코딩하면 공지 글이 잘못된
|
|
158
|
+
블로그 canonical 을 갖게 됩니다.
|
|
159
|
+
|
|
160
|
+
```tsx
|
|
161
|
+
import { buildPostMetadata } from "@roottale/cms-renderer-next/routes";
|
|
162
|
+
import { COLLECTIONS } from "@/lib/collections"; // collections.md 참고
|
|
163
|
+
|
|
164
|
+
export async function generateMetadata({ params }: Props): Promise<Metadata> {
|
|
165
|
+
const { slug } = await params;
|
|
166
|
+
const post = await getPost(slug);
|
|
167
|
+
if (!post) return {};
|
|
168
|
+
return buildPostMetadata(post, {
|
|
169
|
+
siteUrl: process.env.NEXT_PUBLIC_SITE_URL,
|
|
170
|
+
collections: COLLECTIONS, // collectionKey 로 /notice·/blog 자동 구분
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
`post.collectionKey`(공개 API의 `collection_key`)가 어느 섹션에도 안 맞으면
|
|
176
|
+
canonical 을 생략합니다(섹션 없는 글은 상세·sitemap에서 제외되는 규칙과 동일).
|
|
177
|
+
단일 블로그 사이트는 기존처럼 `path: "/blog/" + post.slug` 만 주면 됩니다.
|
|
178
|
+
|
|
117
179
|
## slug 변경 시 301 리다이렉트
|
|
118
180
|
|
|
119
181
|
글 slug를 바꿔도 옛 URL이 깨지지 않습니다. API가 slug history로 글을 찾아
|
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
import type { Metadata } from "next";
|
|
5
5
|
import { notFound, permanentRedirect } from "next/navigation";
|
|
6
6
|
import { RootTaleBlogPost } from "@roottale/cms-renderer-next/server";
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
buildPostMetadata,
|
|
9
|
+
postRedirectPath,
|
|
10
|
+
} from "@roottale/cms-renderer-next/routes";
|
|
8
11
|
|
|
9
12
|
import { getAllPosts, getPost } from "@/lib/blog";
|
|
10
13
|
|
|
@@ -21,24 +24,11 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
|
|
|
21
24
|
const { slug } = await params;
|
|
22
25
|
const post = await getPost(slug);
|
|
23
26
|
if (!post) return {};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
description,
|
|
30
|
-
...(seo?.canonical ? { alternates: { canonical: seo.canonical } } : {}),
|
|
31
|
-
...(seo?.noindex || seo?.nofollow
|
|
32
|
-
? { robots: { index: !seo?.noindex, follow: !seo?.nofollow } }
|
|
33
|
-
: {}),
|
|
34
|
-
openGraph: {
|
|
35
|
-
type: "article",
|
|
36
|
-
title,
|
|
37
|
-
description,
|
|
38
|
-
publishedTime: post.date,
|
|
39
|
-
...(post.image ? { images: [{ url: seo?.ogImage || post.image, alt: title }] } : {}),
|
|
40
|
-
},
|
|
41
|
-
};
|
|
27
|
+
// 어드민 SEO 패널(metaJson.seo) override + self-canonical 을 1줄로.
|
|
28
|
+
return buildPostMetadata(post, {
|
|
29
|
+
siteUrl: process.env.NEXT_PUBLIC_SITE_URL,
|
|
30
|
+
path: `/blog/${post.slug}`,
|
|
31
|
+
});
|
|
42
32
|
}
|
|
43
33
|
|
|
44
34
|
export default async function PostPage({ params }: Props) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roottale/cms-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "RootTale CMS integration MCP server — bundled integration docs, Next.js example code, and public API lookup tools. Run with: npx @roottale/cms-mcp",
|
|
6
6
|
"bin": {
|