补充 Artalk 和博客文章页
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-04-05 20:34:57 +08:00
parent 29b3c89c40
commit 5e53a213e6
8 changed files with 162 additions and 11 deletions

View File

@ -0,0 +1,30 @@
<script lang="ts">
// https://artalk.js.org/zh/develop/import-framework
import Artalk from 'artalk'
import { onMount, onDestroy } from 'svelte'
import 'artalk/Artalk.css'
let el: HTMLElement
let artalk: Artalk
onMount(() => {
artalk = Artalk.init({
el: el,
pageKey: location.pathname,
pageTitle: document.title,
server: 'https://artalk.sv.passthem.top',
site: '小帕的小窝',
darkMode: 'auto',
})
onDestroy(() => {
if (artalk) {
artalk.destroy()
}
})
})
</script>
<div class="comment" bind:this={el}></div>

View File

@ -28,7 +28,7 @@ export const MarkdocTreeRender: React.FC<{
tree: RenderableTreeNode
}> = ({ tree }) => {
return (
<div className="markdoc-container">
<div className="markdoc-container prose">
{Markdoc.renderers.react(tree, React, { components: { CodeBlock } })}
</div>
)