feat(blog) fix style

This commit is contained in:
lumither committed 2024-05-29 18:35:53 +08:00
1 parent bfee26609e
commit b4007b6c6e
5 files changed
+18 -15

No files matched your search

+7 -4
View File
@@ -16,8 +16,11 @@ type Props = {
}
async function Generate(props: Props) {
const response = await axios(`http://localhost:${ process.env.BACKEND_PORT }/api/get/post/${ props.id }`);
if (response.status !== 200) {
let response: any;
try {
response = await axios(`http://localhost:${ process.env.BACKEND_PORT }/api/get/post/${ props.id }`);
} catch (e) {
return (
<Card className={ `w-full` }>
<CardBody>
@@ -27,6 +30,7 @@ async function Generate(props: Props) {
);
}
let post_data = response.data;
return (
@@ -34,12 +38,11 @@ async function Generate(props: Props) {
<Card className={ `w-full` }>
<CardBody>
<Markdown
className={ `mx-5 my-5 max-w-none prose dark:prose-invert sm:prose-sm md:prose-md lg:prose-lg` }
className={ `p-5 max-w-prose text-justify text-pretty会 prose prose-sm dark:prose-invert md:prose-md lg:prose-lg` }
remarkPlugins={ [ remarkGfm, remarkToc, remarkFrontmatter ] }
rehypePlugins={ [ rehypeHighlight, rehypeRaw, rehypeSanitize ] }
>{ (post_data as any)['content'] }</Markdown>
</CardBody>
</Card>
</div>
);