mirror of
https://github.com/pengzhanbo/vuepress-theme-plume.git
synced 2026-04-25 11:28:13 +08:00
23 lines
565 B
TypeScript
23 lines
565 B
TypeScript
import { computed } from 'vue'
|
|
import { usePostList } from './blog-data.js'
|
|
import { useData } from './data.js'
|
|
|
|
export function useBlogPageData() {
|
|
const { page } = useData()
|
|
const postList = usePostList()
|
|
|
|
const isBlogPost = computed(() => {
|
|
return postList.value.some(item => item.path === page.value.path)
|
|
})
|
|
|
|
const isBlogLayout = computed(() => {
|
|
const type = page.value.type
|
|
return type === 'blog' || type === 'blog-archives' || type === 'blog-tags' || type === 'blog-categories'
|
|
})
|
|
|
|
return {
|
|
isBlogPost,
|
|
isBlogLayout,
|
|
}
|
|
}
|