Replies: 3 comments 3 replies
-
EDIT: won't work for createContentLoader, see comments below async configs are supported. you can have something like this: // .vitepress/config.ts
export default async () => {
// await createContentLoader ...
return defineConfig({
// ...
})
} Haven't checked, but top level awaits are probably also supported. |
Beta Was this translation helpful? Give feedback.
-
Finally, I find a way to override the // MyVPSidebar.vue
import { data } from '../../posts.data' // it use createContentLoader
const { hasSidebar } = useSidebar()
const sidebarGroups = [{
items: data.map(item => ({
text: item.frontmatter.title,
link: item.url
}))
}]
// other code... in
to make |
Beta Was this translation helpful? Give feedback.
-
Can we reopen that since @brc-dd answer doesn't help at all with the following problem:
I wasn't able to repeat @Jiny3213 work-around because |
Beta Was this translation helpful? Give feedback.
-
I has a data loader using createContentLoader to load all file in
post/*.md
Now I want to use it to load my posts in
config.js
to generate thethemeConfig.sidebar
, but the createContentLoader is async load.How can I do this?
Beta Was this translation helpful? Give feedback.
All reactions