Skip to content

Commit 79be8e4

Browse files
committed
chore: tweak
1 parent 631fb7e commit 79be8e4

4 files changed

Lines changed: 22 additions & 27 deletions

File tree

plugins/plugin-md-power/src/client/components/VPCodeTree.vue

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,22 @@ provide('on-file-tree-node-click', (filepath: string, type: 'file' | 'folder') =
1919
})
2020
2121
onMounted(() => {
22-
watch(
23-
() => activeNode.value,
24-
() => {
25-
if (codePanel.value) {
26-
const items = Array.from(codePanel.value.querySelectorAll('.code-block-title'))
27-
let hasActive = false
28-
items.forEach((item) => {
29-
if (item.getAttribute('data-title') === activeNode.value) {
30-
item.classList.add('active')
31-
hasActive = true
32-
}
33-
else {
34-
item.classList.remove('active')
35-
}
36-
})
37-
isEmpty.value = !hasActive
38-
}
39-
},
40-
{ immediate: true },
41-
)
22+
watch(activeNode, () => {
23+
if (codePanel.value) {
24+
const items = Array.from(codePanel.value.querySelectorAll('.code-block-title'))
25+
let hasActive = false
26+
items.forEach((item) => {
27+
if (item.getAttribute('data-title') === activeNode.value) {
28+
item.classList.add('active')
29+
hasActive = true
30+
}
31+
else {
32+
item.classList.remove('active')
33+
}
34+
})
35+
isEmpty.value = !hasActive
36+
}
37+
}, { immediate: true })
4238
})
4339
</script>
4440

plugins/plugin-md-power/src/node/embed/createEmbedRuleBlock.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ export function createEmbedRuleBlock<Meta extends Record<string, any> = Record<s
136136

137137
md.renderer.rules[name] = (tokens, index, _, env: MarkdownEnv) => {
138138
const token = tokens[index]
139-
token.content = content(token.meta, token.content, env)
140-
return token.content
139+
return content(token.meta, token.content, env)
141140
}
142141
}

theme/src/client/features/components/RepoCard.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const { loaded, data } = useGithubRepo(toRef(props, 'repo'), toRef(props, 'provi
2727
</span>
2828
<span class="repo-visibility" :class="{ archived: data.archived }">{{ data.visibility + (data.template ? ' Template' : '') }}{{ data.archived ? ' archive' : '' }}</span>
2929
</p>
30-
<p class="repo-desc">
30+
<p class="repo-desc" :title="data.description">
3131
{{ data.description }}
3232
</p>
3333
<div class="repo-info">
@@ -36,13 +36,13 @@ const { loaded, data } = useGithubRepo(toRef(props, 'repo'), toRef(props, 'provi
3636
class="repo-language" :style="{ 'background-color': data.languageColor }"
3737
/><span>{{ data.language }}</span>
3838
</p>
39-
<p :title="`Github Stars: ${data.stars}`">
39+
<p :title="`Stars: ${data.stars}`">
4040
<span class="vpi-github-star" /><span>{{ data.convertStars }}</span>
4141
</p>
42-
<p :title="`Github Forks: ${data.forks}`">
42+
<p :title="`Forks: ${data.forks}`">
4343
<span class="vpi-github-fork" /><span>{{ data.convertForks }}</span>
4444
</p>
45-
<p v-if="data.license" :title="`Github License: ${data.license.name}`">
45+
<p v-if="data.license" :title="`License: ${data.license.name}`">
4646
<span class="vpi-github-license" /><span>{{ data.license.name }}</span>
4747
</p>
4848
</div>

theme/src/node/autoFrontmatter/generate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type {
88
import { objectKeys, sleep } from '@pengzhanbo/utils'
99
import { type FSWatcher, watch } from 'chokidar'
1010
import matter from 'gray-matter'
11-
import yaml from 'js-yaml'
11+
import * as yaml from 'js-yaml'
1212
import pMap from 'p-map'
1313
import { fs, hash as getHash, path, tinyglobby } from 'vuepress/utils'
1414
import { logger } from '../utils/index.js'

0 commit comments

Comments
 (0)