chore: rem
Signed-off-by: Ameya Shenoy <shenoy.ameya@gmail.com>
This commit is contained in:
parent
8fb1e43f52
commit
00628a1876
2 changed files with 0 additions and 40 deletions
|
|
@ -1,24 +0,0 @@
|
|||
import { GetStaticPaths, GetStaticProps } from "next";
|
||||
import { getMarkdownContent } from "@/lib/markdown";
|
||||
|
||||
export default async function BlogPost() {
|
||||
const content = await getMarkdownContent(`docker_primer.md`);
|
||||
|
||||
return (
|
||||
<main className="flex items-center justify-center h-screen">
|
||||
<div className="w-[95vw]" dangerouslySetInnerHTML={{ __html: content }} />
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
// export const getStaticPaths: GetStaticPaths = async () => {
|
||||
// // Here you would fetch the list of markdown files to create paths
|
||||
// const paths = [{ params: { slug: "example" } }]; // Example path
|
||||
// return { paths, fallback: false };
|
||||
// };
|
||||
//
|
||||
// export const getStaticProps: GetStaticProps = async ({ params }) => {
|
||||
// console.log(params?.slug);
|
||||
// const content = await getMarkdownContent(`docker_primer.md`);
|
||||
// return { props: { content } };
|
||||
// };
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
// utils/markdown.ts
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
import { remark } from "remark";
|
||||
import html from "remark-html";
|
||||
|
||||
const markdownDirectory = path.join(process.cwd(), "src/app/blog/content");
|
||||
console.log(markdownDirectory)
|
||||
|
||||
export async function getMarkdownContent(fileName: string) {
|
||||
const filePath = path.join(markdownDirectory, fileName);
|
||||
const fileContents = fs.readFileSync(filePath, "utf8");
|
||||
|
||||
const processedContent = await remark().use(html).process(fileContents);
|
||||
return processedContent.toString();
|
||||
}
|
||||
Loading…
Reference in a new issue