feat: 基础文章编辑功能
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
@@ -10,3 +15,4 @@
|
||||
.markdown-body h6 {
|
||||
border-bottom: none ;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user