valaxy-addon-twikoo

NPM version

English | 简体中文

Integrate the Twikoo comment system with Valaxy sites and themes.

Installation

bash
pnpm add valaxy-addon-twikoo

Site configuration

Enable comments and load the addon in valaxy.config.ts:

ts
import { defineValaxyConfig } from 'valaxy'
import { addonTwikoo } from 'valaxy-addon-twikoo'

export default defineValaxyConfig({
  siteConfig: {
    comment: {
      enable: true,
    },
  },
  addons: [
    addonTwikoo(),
  ],
})

Theme integration

Skip this section when you use a theme that already integrates Twikoo.

Create a theme component such as YunTwikoo.vue. See ValaxyMain.vue for an integration example.

vue
<script lang="ts" setup>
import { useTwikooWithOptions } from 'valaxy-addon-twikoo'
import 'valaxy-addon-twikoo/client/styles/index.scss'

useTwikooWithOptions()
</script>

<template>
  <div id="tcomment" w="full" />
</template>

Contributors