feat: 基础文章编辑功能

This commit is contained in:
2026-07-06 18:54:15 +08:00
parent 12e521891a
commit 59664d139d
2 changed files with 13 additions and 7 deletions

View File

@@ -1,9 +1,10 @@
---
import "github-markdown-css/github-markdown-light.css"
import "@/styles/github-markdown.css"
import Layout from "@/layouts/Layout.astro";
import {http} from "@/lib/request.ts";
import {highlightHtmlWithJsdom} from "@/lib/highlight.js";
import "github-markdown-css/github-markdown-light.css"
import "@/styles/github-markdown.css"
import {formatDatetime} from "@/lib/format.ts";
const {slug} = Astro.params;
@@ -40,7 +41,7 @@ const content = await highlightHtmlWithJsdom(data.content)
<path d="M12 18h.01"/>
<path d="M16 18h.01"/>
</svg>
{formatDatetime(data.published_at)}
{formatDatetime(data.published_at,'YYYY 年 MM 月 DD 日')}
</div>
<div class="post markdown-body" set:html={content}></div>
@@ -48,8 +49,7 @@ const content = await highlightHtmlWithJsdom(data.content)
<style>
.post-title{
margin-block-start: 0;
margin-block-end: 24px;
margin-bottom: 16px;
}
@media (max-width: 768px) {
@@ -74,7 +74,7 @@ const content = await highlightHtmlWithJsdom(data.content)
.post {
background: #fff;
border-radius: 12px;
border-radius: 16px;
overflow: auto;
padding: 24px;
box-shadow: rgba(149, 157, 165, 0.2) 0 2px 14px -4px;

View File

@@ -2,6 +2,11 @@
font-size: 1.1em;
}
h1{
margin-block-start: 0;
margin-block-end: 0;
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
@@ -9,4 +14,5 @@
.markdown-body h5,
.markdown-body h6 {
border-bottom: none ;
}
}