Skip to content

Commit

Permalink
feat(theme-yun): support artalk comment system (#370)
Browse files Browse the repository at this point in the history
  • Loading branch information
krau committed Mar 30, 2024
1 parent e48f2a2 commit a7d24df
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
"typedoc-vitepress-theme": "1.0.0-next.3",
"typescript": "^5.4.3",
"unbuild": "^2.0.0",
"valaxy-addon-artalk": "^0.1.0",
"vitest": "^1.4.0",
"vue-tsc": "2.0.6",
"zx": "^7.2.3"
Expand Down
3 changes: 2 additions & 1 deletion packages/valaxy-theme-yun/components/YunComment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useRuntimeConfig } from 'valaxy'
import { computed, ref } from 'vue'
const runtimeConfig = useRuntimeConfig()
const supportCommentAddons = ['valaxy-addon-waline', 'valaxy-addon-twikoo']
const supportCommentAddons = ['valaxy-addon-waline', 'valaxy-addon-twikoo', 'valaxy-addon-artalk']
const commentSystems = computed(() => {
return supportCommentAddons.filter(addonName => runtimeConfig.value.addons[addonName]).map(addonName => addonName.split('-')[2])
Expand All @@ -20,6 +20,7 @@ const activeComment = ref(commentSystems.value[0])
</div>
<YunWaline v-if="activeComment === 'waline'" />
<YunTwikoo v-if="activeComment === 'twikoo'" />
<YunArtalk v-if="activeComment === 'artalk'" />
<slot />
</ClientOnly>
</YunCard>
Expand Down
12 changes: 12 additions & 0 deletions packages/valaxy-theme-yun/components/third/YunArtalk.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<script lang="ts" setup>
import * as addonArtalk from 'valaxy-addon-artalk'
import 'valaxy-addon-artalk/client/styles/index.scss'
import { isEmptyAddon } from 'valaxy'
if (!isEmptyAddon(addonArtalk))
addonArtalk.useArtalkWithOptions()
</script>

<template>
<ArtalkClient />
</template>
58 changes: 58 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 comment on commit a7d24df

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Published on https://yun.valaxy.site as production
🚀 Deployed on https://66084f15e50ac413820f0584--valaxy.netlify.app

Please sign in to comment.