Files
blog-frontend-v2/src/components/Artalk.svelte
passthem 5e53a213e6
All checks were successful
continuous-integration/drone/push Build is passing
补充 Artalk 和博客文章页
2026-04-05 20:34:57 +08:00

31 lines
604 B
Svelte

<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>