Archived
init
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
import React from "react";
|
||||
|
||||
export default function ContentTable() {
|
||||
return <div>ContentTable</div>;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import React from "react";
|
||||
|
||||
export default function Sidebar() {
|
||||
return <div>Sidebar</div>;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import ContentTable from "./ContentTable";
|
||||
import Sidebar from "./Sidebar";
|
||||
import styles from "../../../styles/Tutorial.module.scss";
|
||||
|
||||
export default function Layout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<div className={styles.tutorial}>
|
||||
<ContentTable />
|
||||
<div className="tutorialContent">{children}</div>
|
||||
<Sidebar />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { marked } from "marked";
|
||||
export default async function Page({
|
||||
params,
|
||||
}: {
|
||||
params: { tutorial: string };
|
||||
}) {
|
||||
const requestData = await fetch(`http://127.0.0.1:3000/test.json`, {
|
||||
cache: "no-store", //! Just for dev
|
||||
/*next: { revalidate: 10 }*/
|
||||
});
|
||||
const data = await requestData.json();
|
||||
|
||||
return (
|
||||
<div
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: marked.parse(data.markdown) ?? "",
|
||||
}}
|
||||
></div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user