mirror of https://github.com/vuejs/vitepress
parent
35f36a96bb
commit
f1233ab5bb
@ -1,4 +1,12 @@
|
|||||||
import { useData as useData$ } from 'vitepress'
|
import { useData as useData$ } from 'vitepress'
|
||||||
import type { DefaultTheme } from 'vitepress/theme'
|
import type { DefaultTheme } from 'vitepress/theme'
|
||||||
|
|
||||||
export const useData: typeof useData$<DefaultTheme.Config> = useData$
|
export function useData() {
|
||||||
|
const data = useData$<DefaultTheme.Config>()
|
||||||
|
|
||||||
|
// Allow an arbitrary layout to be used as the home layout
|
||||||
|
;(data.frontmatter as any).isHomeLayout ??=
|
||||||
|
(data.frontmatter as any).layout === 'home'
|
||||||
|
|
||||||
|
return data
|
||||||
|
}
|
||||||
|
Loading…
Reference in new issue