Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/content/docs/ko/guides/cms/apostrophecms.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -392,24 +392,24 @@ const { page, pieces } = Astro.props.aposData;

개별 블로그 게시물을 표시하려면 다음 코드를 사용하여 Astro 프로젝트의 `src/templates` 폴더에 `BlogShow.astro` 파일을 생성합니다.

이 컴포넌트는 `<AposArea>` 컴포넌트를 사용하여 `content` 영역에 추가된 모든 위젯과 동일한 이름의 필드에 입력된 `authorName` 및 `publicationDate` 콘텐츠를 표시합니다.
이 컴포넌트는 `<AposArea>` 컴포넌트를 사용하여 `main` 영역에 추가된 모든 위젯과 동일한 이름의 필드에 입력된 `authorName` 및 `publicationDate` 콘텐츠를 표시합니다.

```js title="src/templates/BlogShow.astro"
---
import AposArea from '@apostrophecms/apostrophe-astro/components/AposArea.astro';
import dayjs from 'dayjs';
import AposArea from "@apostrophecms/apostrophe-astro/components/AposArea.astro";
import dayjs from "dayjs";

const { page, piece } = Astro.props.aposData;
const { main } = piece;
---

<section class="bp-content">
<h1>{ piece.title }</h1>
<h3>Created by: { piece.authorName }
<h1>{piece.title}</h1>
<h3>Created by: {piece.authorName}</h3>
<h4>
Released On { dayjs(piece.publicationDate).format('MMMM D, YYYY') }
Released On {dayjs(piece.publicationDate).format("MMMM D, YYYY")}
</h4>
<AposArea area={content} />
<AposArea area={main} />
</section>
```

Expand Down
30 changes: 16 additions & 14 deletions src/content/docs/ko/guides/cms/builderio.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ const builderModel = import.meta.env.BUILDER_BLOGPOST_MODEL;

모든 게시물 제목 목록을 가져와 표시하려면 각각 자체 페이지로 연결되는 `src/pages/index.astro` 파일에 다음 콘텐츠를 추가하세요.

```astro title="src/pages/index.astro" {9}
```astro title="src/pages/index.astro" {8}
---
const builderAPIpublicKey = import.meta.env.BUILDER_API_PUBLIC_KEY;
const builderModel = import.meta.env.BUILDER_BLOGPOST_MODEL;
Expand All @@ -221,9 +221,9 @@ const { results: posts } = await fetch(
<body>
<ul>
{
posts.flatMap(({ data: { slug, title } }) => (
posts.flatMap((post: any) => (
<li>
<a href={`/posts/${slug}`}>{title}</a>
<a href={`/posts/${post.data.slug}`}>{post.data.title}</a>
</li>
))
}
Expand Down Expand Up @@ -266,26 +266,28 @@ index 경로로 이동하면 블로그 게시물 제목이 포함된 링크 목

다음 코드 조각에서는 이들 각각을 강조 표시합니다.

```astro title="src/pages/posts/[slug].astro" ins={2, 26, 33, 40, 51}
```astro title="src/pages/posts/[slug].astro" ins={2, 26, 33, 41, 52}
---
export async function getStaticPaths() {
const builderModel = import.meta.env.BUILDER_BLOGPOST_MODEL;
const builderAPIpublicKey = import.meta.env.BUILDER_API_PUBLIC_KEY;
const { results: posts } = await fetch(
`https://cdn.builder.io/api/v3/content/${builderModel}?${new URLSearchParams({
apiKey: builderAPIpublicKey,
fields: ['data.slug', 'data.title'].join(','),
cachebust: 'true',
}).toString()}`
`https://cdn.builder.io/api/v3/content/${builderModel}?${new URLSearchParams(
{
apiKey: builderAPIpublicKey,
fields: ['data.slug', 'data.title'].join(','),
cachebust: 'true',
},
).toString()}`
)
.then((res) => res.json())
.catch
// ...오류 처리...);
();
return posts.map(({ data: { slug, title } }) => ({
params: { slug },
props: { title },
}))
return posts.map((post: any) => ({
params: { slug: post.data.slug },
props: { title: post.data.title },
}));
}
const { slug } = Astro.params;
const { title } = Astro.props;
Expand All @@ -299,7 +301,7 @@ const { html: postHTML } = await fetch(
url: encodedUrl,
'query.data.slug': slug,
cachebust: 'true',
}).toString()}`
}).toString()}`,
)
.then((res) => res.json())
.catch();
Expand Down
34 changes: 21 additions & 13 deletions src/content/docs/ko/guides/cms/buttercms.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,25 @@ import { butterClient } from "../lib/buttercms";
const response = await butterClient.content.retrieve(["shopitem"]);

interface ShopItem {
name: string,
price: number,
description: string,
name: string;
price: number;
description: string;
}

const items = response.data.data.shopitem as ShopItem[];
const items = response?.data?.data.shopitem as ShopItem[];
---

<body>
{items.map(item => <div>
<h2>{item.name} - ${item.price}</h2>
<p set:html={item.description}></p>
</div>)}
{
items.map((item) => (
<div>
<h2>
{item.name} - ${item.price}
</h2>
<p set:html={item.description} />
</div>
))
}
</body>
```

Expand All @@ -110,16 +117,17 @@ const items = response.data.data.shopitem as ShopItem[];
---
import { butterClient } from "../lib/buttercms";
const response = await butterClient.page.retrieve("*", "simple-page");
const pageData = response.data.data;
const pageData = response?.data?.data;

interface Fields {
seo_title: string,
headline: string,
hero_image: string,
seo_title: string;
headline: string;
hero_image: string;
}

const fields = pageData.fields as Fields;
const fields = pageData?.fields as Fields;
---

<html>
<title>{fields.seo_title}</title>
<body>
Expand Down
7 changes: 5 additions & 2 deletions src/content/docs/ko/guides/cms/cloudcannon.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,16 @@ const posts = await getCollection('blog');

### 개별 항목 표시하기

개별 포스트의 콘텐츠를 표시하려면 `<Content />` 컴포넌트를 가져와 [콘텐츠를 HTML로 렌더링](/ko/guides/content-collections/#본문-콘텐츠-렌더링하기)할 수 있습니다.
개별 포스트의 콘텐츠를 표시하려면 `<Content />` 컴포넌트를 사용하여 [`render()`로 콘텐츠를 HTML로 렌더링](/ko/guides/content-collections/#본문-콘텐츠-렌더링하기)할 수 있습니다.

```astro title="src/pages/blog/my-first-post.astro" {4-5}
```astro title="src/pages/blog/my-first-post.astro" {8,14} ", render"
---
import { getEntry, render } from 'astro:content';

const entry = await getEntry('blog', 'my-first-post');
if (!entry) {
throw new Error('Blog post not found');
}
const { Content } = await render(entry);
---

Expand Down
5 changes: 2 additions & 3 deletions src/content/docs/ko/guides/cms/cosmic.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ PUBLIC_COSMIC_READ_KEY=YOUR_READ_KEY
title={post.title}
href={post.slug}
body={post.metadata.excerpt}
tags={post.metadata.tags.map((tag) => tag)}
tags={post.metadata.tags.map((tag: any) => tag)}
/>
))
}
Expand Down Expand Up @@ -151,7 +151,7 @@ const data = await getAllPosts()
title={post.title}
href={post.slug}
body={post.metadata.excerpt}
tags={post.metadata.tags.map((tag) => tag)}
tags={post.metadata.tags.map((tag: any) => tag)}
/>
))
}
Expand Down Expand Up @@ -206,7 +206,6 @@ const { post } = Astro.props
format="webp"
width={1200}
height={675}
aspectRatio={16 / 9}
quality={50}
alt={`Cover image for the blog ${post.title}`}
class={'my-12 rounded-md shadow-lg'}
Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/ko/guides/cms/drupal.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,8 @@ const articles = dataFormatter.deserialize(json);
import {DrupalJsonApiParams} from "drupal-jsonapi-params";
import type {TJsonApiBody} from "jsona/lib/JsonaTypes";

import type { DrupalNode } from "../types";
import {getArticles} from "../api/drupal";
import type { DrupalNode } from "../../types";
import { getArticles } from "../../api/drupal";

// 게시된 모든 articles 가져오기
const articles = await getArticles();
Expand Down
8 changes: 4 additions & 4 deletions src/content/docs/ko/guides/cms/ghost.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ const posts = await ghostClient.posts
<body>

{
posts.map((post) => (
posts?.map((post) => (
<a href={`/post/${post.slug}`}>
<h1> {post.title} </h1>
</a>
Expand Down Expand Up @@ -224,7 +224,7 @@ export async function getStaticPaths() {
console.error(err);
});

return posts.map((post) => {
return posts?.map((post) => {
return {
params: {
slug: post.slug,
Expand Down Expand Up @@ -253,7 +253,7 @@ export async function getStaticPaths() {
.catch((err) => {
console.error(err);
});
return posts.map((post) => {
return posts?.map((post) => {
return {
params: {
slug: post.slug,
Expand Down Expand Up @@ -296,7 +296,7 @@ const { post } = Astro.props;
<LinkCard title="Ghost CMS & Astro 튜토리얼" href="https://matthiesen.xyz/blog/astro-ghostcms" />
<LinkCard title="Astro + Ghost + Tailwind CSS" href="https://andr.ec/posts/astro-ghost-blog/" />
<LinkCard title="Astro와 Ghost로 기업 사이트 구축하기" href="https://artabric.com/post/building-a-corporate-site-with-astro-and-ghost/" />
<LinkCard title="`astro-starter-ghost`" href="https://github.com/PhilDL/astro-starter-ghost" />
<LinkCard title="astro-starter-ghost" href="https://github.com/PhilDL/astro-starter-ghost" />

</CardGrid>

Expand Down
18 changes: 10 additions & 8 deletions src/content/docs/ko/guides/cms/keystatic.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ Keystatic 관리 UI 대시보드를 시작하려면 Astro의 개발 서버를
</FileTree>

5. 코드 편집기에서 해당 파일로 이동하여 입력한 Markdown 콘텐츠를 볼 수 있는지 확인합니다. 예를 들어:
```markdown
```markdown title="src/content/posts/my-first-post.mdoc"
---
title: My First Post
---
Expand All @@ -190,7 +190,7 @@ Keystatic 관리 UI 대시보드를 시작하려면 Astro의 개발 서버를

다음 예시에서는 개별 게시물 페이지에 대한 링크와 함께 각 게시물 제목 목록을 표시합니다.

```tsx {4}
```astro title="src/pages/posts/index.astro" {4}
---
import { getCollection } from 'astro:content'

Expand All @@ -207,21 +207,23 @@ const posts = await getCollection('posts')

### 단일 항목 표시

개별 게시물의 콘텐츠를 표시하려면 `<Content />` 컴포넌트를 가져와 사용하여 [콘텐츠를 HTML로 렌더링](/ko/guides/content-collections/#본문-콘텐츠-렌더링하기)할 수 있습니다.
개별 게시물의 콘텐츠를 표시하려면 `<Content />` 컴포넌트를 사용하여 [`render()`로 콘텐츠를 HTML로 렌더링](/ko/guides/content-collections/#본문-콘텐츠-렌더링하기)할 수 있습니다.

```tsx {4-5}
```astro title="src/pages/posts/my-first-post.astro" {8,13} ", render"
---
import { getEntry } from 'astro:content'
import { getEntry, render } from "astro:content";

const post = await getEntry('posts', 'my-first-post')
const { Content } = await post.render()
const post = await getEntry("posts", "my-first-post");
if (!post) {
throw new Error("Post not found");
}
const { Content } = await render(post);
---

<main>
<h1>{post.data.title}</h1>
<Content />
</main>

```

쿼리, 필터링, 컬렉션 콘텐츠 표시 등에 대한 자세한 내용은 전체 콘텐츠 [컬렉션 문서](/ko/guides/content-collections/)를 참조하세요.
Expand Down
3 changes: 3 additions & 0 deletions src/content/docs/ko/guides/cms/kontent-ai.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ export async function getStaticPaths() {
.items<BlogPost>()
.type(contentTypes.blog_post.codename)
.toPromise()
}
---
```

Expand Down Expand Up @@ -438,6 +439,7 @@ const blogPost: BlogPost = Astro.props.blogPost
<Fragment set:html={blogPost.elements.teaser.value} />
<Fragment set:html={blogPost.elements.content.value} />
<time>{new Date(blogPost.elements.date.value ?? "")}</time>
</article>
</body>
</html>
```
Expand Down Expand Up @@ -517,6 +519,7 @@ try {
<Fragment set:html={blogPost.elements.teaser.value} />
<Fragment set:html={blogPost.elements.content.value} />
<time>{new Date(blogPost.elements.date.value ?? '')}</time>
</article>
</body>
</html>
```
Expand Down
Loading
Loading