mirror of
https://github.com/Lumither/nocturne.git
synced 2026-10-17 18:36:21 +00:00
feat(blog) fix style
This commit is contained in:
5 files changed
+18
-15
No files matched your search
@@ -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>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user