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 Layout from "@/layouts/Layout.astro";
|
||||||
import {http} from "@/lib/request.ts";
|
import {http} from "@/lib/request.ts";
|
||||||
import {highlightHtmlWithJsdom} from "@/lib/highlight.js";
|
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";
|
import {formatDatetime} from "@/lib/format.ts";
|
||||||
|
|
||||||
const {slug} = Astro.params;
|
const {slug} = Astro.params;
|
||||||
@@ -40,7 +41,7 @@ const content = await highlightHtmlWithJsdom(data.content)
|
|||||||
<path d="M12 18h.01"/>
|
<path d="M12 18h.01"/>
|
||||||
<path d="M16 18h.01"/>
|
<path d="M16 18h.01"/>
|
||||||
</svg>
|
</svg>
|
||||||
{formatDatetime(data.published_at)}
|
{formatDatetime(data.published_at,'YYYY 年 MM 月 DD 日')}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="post markdown-body" set:html={content}></div>
|
<div class="post markdown-body" set:html={content}></div>
|
||||||
@@ -48,8 +49,7 @@ const content = await highlightHtmlWithJsdom(data.content)
|
|||||||
|
|
||||||
<style>
|
<style>
|
||||||
.post-title{
|
.post-title{
|
||||||
margin-block-start: 0;
|
margin-bottom: 16px;
|
||||||
margin-block-end: 24px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
@@ -74,7 +74,7 @@ const content = await highlightHtmlWithJsdom(data.content)
|
|||||||
|
|
||||||
.post {
|
.post {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-radius: 12px;
|
border-radius: 16px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
padding: 24px;
|
padding: 24px;
|
||||||
box-shadow: rgba(149, 157, 165, 0.2) 0 2px 14px -4px;
|
box-shadow: rgba(149, 157, 165, 0.2) 0 2px 14px -4px;
|
||||||
|
|||||||
@@ -2,6 +2,11 @@
|
|||||||
font-size: 1.1em;
|
font-size: 1.1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h1{
|
||||||
|
margin-block-start: 0;
|
||||||
|
margin-block-end: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.markdown-body h1,
|
.markdown-body h1,
|
||||||
.markdown-body h2,
|
.markdown-body h2,
|
||||||
.markdown-body h3,
|
.markdown-body h3,
|
||||||
@@ -9,4 +14,5 @@
|
|||||||
.markdown-body h5,
|
.markdown-body h5,
|
||||||
.markdown-body h6 {
|
.markdown-body h6 {
|
||||||
border-bottom: none ;
|
border-bottom: none ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user