You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Hello,
Actually, I have to create a loader for each language, and then import all of them in my vue component.
// @ts-expect-error - vitepress types are not availableimport{dataasrootData}from'../../data/posts.data'// @ts-expect-error - vitepress types are not availableimport{dataasfrData}from'../../data/fr-posts.data'import{computed}from'vue';constdata: Record<string,any>={root: rootData,fr: frData}const{ localeIndex }=useData()constposts=computed(()=>data[localeIndex.value])
Describe the solution you'd like
I would like to have to only create a single content loader and based on my locales configuration (and maybe an option) retrive all content.
For example: posts/*.md should get posts/*.md (the root) and fr/posts/*.md (the fr locale).
This should already work. Can you share an example where createContentLoader doesn't respect the specified glob pattern?
Also, regarding those ts-expect-error comments in your code, you need to declare types in your data file - those files are not generated by vitepress - https://vitepress.dev/guide/data-loading#typed-data-loaders (for createContentLoader the Data type should be array of ContentData, refer docs above that section too)
Is your feature request related to a problem? Please describe.
Hello,
Actually, I have to create a loader for each language, and then import all of them in my vue component.
Describe the solution you'd like
I would like to have to only create a single content loader and based on my locales configuration (and maybe an option) retrive all content.
For example:
posts/*.md
should getposts/*.md
(the root) andfr/posts/*.md
(the fr locale).Describe alternatives you've considered
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: