Preventing recursive directory scanning in media libraries #496
-
Usecase: migrated a large-ish WP site to Docusaurus. Currently most image assets are dumped in one folder so I don't have major headaches when I implement i18n (which Docusaurus handles strangely, but anyway). The subfolders contain assets for very specific image-heavy non .md pages (which localise differently using a translate function in react) which I'd like for the media library to not scan and load. So we have:
For performance and usability reasons, it would be great to ignore all subfolders (which are defined in their own collections/singletons) when looking at the default media library. Is this currently possible? Any Docusaurus maintainers able to weigh in with some advice? I'd like to clean things up at some point, but I need to feel out the workflow with Sveltia and i18n before I start moving stuff around. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
We don’t have any control for it yet. The current behaviour of showing all the files recursively is actually temporary before these features are implemented.
So, I can add a temporary option to disable the recursive scanning if needed. |
Beta Was this translation helpful? Give feedback.
-
No worries, I'll sit tight and should really clean out the folder anyway. On the Docusaurus i18n topic, is it possible to define different locations per-locale? The Sveltia side-by-side i18n implementation is phenomenal but Docusaurus uses Thank you so much for your work on Sveltia so far ❤️ |
Beta Was this translation helpful? Give feedback.
-
Actually, never mind on the per-locale settings. I've written a script which runs before Putting it here for the sake of anybody Googling.
Add this to
|
Beta Was this translation helpful? Give feedback.
We don’t have any control for it yet. The current behaviour of showing all the files recursively is actually temporary before these features are implemented.
So, I can add a temporary option to disable the recursive scanning if needed.