Skip to content

Commit

Permalink
chore: release addon-meting and refactor code (#452)
Browse files Browse the repository at this point in the history
  • Loading branch information
yixiaojiu authored Sep 15, 2024
1 parent b9207f0 commit 7c6108f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
14 changes: 12 additions & 2 deletions packages/valaxy-addon-meting/client/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useScriptTag } from '@vueuse/core'
import { useHead } from '@unhead/vue'
import { computed, ref, watch } from 'vue'
import { useSiteConfig } from 'valaxy'
import { useFrontmatter, useSiteConfig } from 'valaxy'
import { useRoute } from 'vue-router'
import { useMetingLoadObserver } from './observer'
import { useAddonMeting } from './options'
Expand Down Expand Up @@ -35,13 +35,23 @@ export function useMeting() {
useMetingLoadObserver(addonMeting.value)
}

interface Frontmatter {
/**
* use aplayer
* @url https://aplayer.js.org/
*/
aplayer?: boolean
}

export function useVisible() {
const route = useRoute()
const addonMeting = useAddonMeting()
const frontmatter = useFrontmatter<Frontmatter>()

const visible = ref(true)

watch(() => route.path, () => {
visible.value = route.meta.frontmatter?.aplayer ?? addonMeting.value?.global ?? true
visible.value = frontmatter.value?.aplayer ?? addonMeting.value?.global ?? true
}, { immediate: true })

return visible
Expand Down
2 changes: 1 addition & 1 deletion packages/valaxy-addon-meting/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "valaxy-addon-meting",
"global": true,
"version": "0.1.3",
"version": "0.1.4",
"license": "MIT",
"repository": {
"url": "https://github.com/YunYouJun/valaxy/tree/main/packages/valaxy-addon-meting",
Expand Down
6 changes: 0 additions & 6 deletions packages/valaxy/types/frontmatter/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,6 @@ export interface PageFrontMatter extends Record<string, any> {
*/
end: boolean

// third-party features
/**
* use aplayer
* @url https://aplayer.js.org/
*/
aplayer: boolean
/**
* use katex
* @url https://katex.org/
Expand Down

1 comment on commit 7c6108f

@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://66e712d839d3a11ae5c62316--valaxy.netlify.app

Please sign in to comment.