added projects
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
rei
2022-12-29 13:42:04 +01:00
parent 446c4a4241
commit e545a596ec
9 changed files with 474 additions and 32 deletions

View File

@@ -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: {