|
|
@ -31,10 +31,10 @@ If you need to dynamically generate the config, you can also default export a fu
|
|
|
|
```ts
|
|
|
|
```ts
|
|
|
|
import { defineConfig } from 'vitepress'
|
|
|
|
import { defineConfig } from 'vitepress'
|
|
|
|
|
|
|
|
|
|
|
|
export default async () => defineConfig({
|
|
|
|
export default async () => {
|
|
|
|
const posts = await (await fetch('https://my-cms.com/blog-posts')).json()
|
|
|
|
const posts = await (await fetch('https://my-cms.com/blog-posts')).json()
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
return defineConfig({
|
|
|
|
// app level config options
|
|
|
|
// app level config options
|
|
|
|
lang: 'en-US',
|
|
|
|
lang: 'en-US',
|
|
|
|
title: 'VitePress',
|
|
|
|
title: 'VitePress',
|
|
|
@ -49,8 +49,8 @@ export default async () => defineConfig({
|
|
|
|
}))
|
|
|
|
}))
|
|
|
|
]
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
You can also use top-level `await`. For example:
|
|
|
|
You can also use top-level `await`. For example:
|
|
|
|