Skip to content

Commit

Permalink
add tutorial with blog guide (#15)
Browse files Browse the repository at this point in the history
* good

* tutorial

* guide 추가

* good
  • Loading branch information
Moon-DaeSeung authored Oct 31, 2024
1 parent d02a7b6 commit 689699a
Show file tree
Hide file tree
Showing 71 changed files with 66,189 additions and 0 deletions.
20 changes: 20 additions & 0 deletions app/[lang]/tutorial/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { NotionRenderer } from "@/components/notion-renderer";
import * as kr from "@/content/tutorial/ko/126ce18c-fd83-80a5-8260-d757c56405b2.json";
import * as en from "@/content/tutorial/en/12ace18c-fd83-8071-b3a5-dd8d21da61cf.json";

export const runtime = "edge";

export async function generateStaticParams() {
return [{ lang: "ko" }, { lang: "en" }];
}

export default function TutorialPage({ params }: { params: { lang: string } }) {
const content = params.lang === "ko" ? kr : en;
const title = content.properties.title.title[0].plain_text;

return (
<div className="max-w-4xl mx-auto py-10">
<NotionRenderer blocks={content.blocks} title={title} />
</div>
);
}
23 changes: 23 additions & 0 deletions components/notion-renderer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"use client";

import { Notion } from "@notionpresso/react";

export const NotionRenderer = ({
blocks,
title,
cover,
}: {
blocks: any[];
title: string;
cover?: string;
}) => {
return (
<Notion>
<Notion.Cover src={cover} />
<Notion.Body>
<Notion.Title title={title} />
<Notion.Blocks blocks={blocks} />
</Notion.Body>
</Notion>
);
};
Loading

0 comments on commit 689699a

Please sign in to comment.