This commit is contained in:
@@ -3,7 +3,7 @@ import fs from "fs";
|
||||
import { ParsedUrlQuery } from "querystring";
|
||||
import {
|
||||
BLOGS_PATH,
|
||||
getFileContentBySlug,
|
||||
getBlogContentBySlug,
|
||||
renderMarkdown,
|
||||
} from "../../utils/markdown";
|
||||
import { MarkdownRenderingResult } from "../../types/types";
|
||||
@@ -27,15 +27,17 @@ export const BlogArticle = ({ frontMatter, html }: MarkdownRenderingResult) => {
|
||||
{date}
|
||||
</div>
|
||||
<div className="lg:text-5xl font-bold">{title}</div>
|
||||
<div className="mt-2 font-medium">
|
||||
By{" "}
|
||||
{authorLink && (
|
||||
<Link href={authorLink} className="text-action">
|
||||
@{author}
|
||||
</Link>
|
||||
)}
|
||||
{!authorLink && <span className="text-action">@{author}</span>}
|
||||
</div>
|
||||
{author && (
|
||||
<div className="mt-2 font-medium">
|
||||
By{" "}
|
||||
{authorLink && (
|
||||
<Link href={authorLink} className="text-action">
|
||||
@{author}
|
||||
</Link>
|
||||
)}
|
||||
{!authorLink && <span className="text-action">@{author}</span>}
|
||||
</div>
|
||||
)}
|
||||
<div className="mt-2">{description}</div>
|
||||
<div
|
||||
className="mt-4 prose prose-headings:text-primary-text prose-p:text-gray-400"
|
||||
@@ -62,7 +64,7 @@ export const getStaticPaths: GetStaticPaths<BlogProps> = async () => {
|
||||
export const getStaticProps: GetStaticProps<MarkdownRenderingResult> = async ({
|
||||
params,
|
||||
}) => {
|
||||
const markdownContent = getFileContentBySlug(params?.slug as string);
|
||||
const markdownContent = getBlogContentBySlug(params?.slug as string);
|
||||
const renderedHTML = await renderMarkdown(markdownContent.content);
|
||||
return {
|
||||
props: {
|
||||
|
||||
Reference in New Issue
Block a user