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
A website with thousands of documents in a collection becomes unmanageable if all documents are stored in the same folder, potentially exceeding the maximum number of files per folder allowed by the operating system.
To avoid this issue, subfolders are created within the main collection folder. The idea is to have a system that automatically creates the folder structure where the newly created document will be placed, based on the file name, similar to the "filePrefix" property but for automatically and configurable directory creation.
Proposed Solution:
Create a configuration parameter "subdir" where a template using placeholders can be configured.
When creating a document titled "post," it would be generated in the folder "/src/content/blog/2024/06/post.md".
Additionally, it should be possible to use custom placeholders. For example, creating a placeholder that returns the first few characters of the title as a directory.
"subdir": "{{customPlaceholder}}"
We would create a script associated with the "customPlaceholder" that generates directories from the first few numbers: customPlaceholder(15678) => "1/5/6/7/".
So, if we created a document titled "345," it would be generated in the folder "/src/content/blog/3/4/345.md".
The text was updated successfully, but these errors were encountered:
Problem:
A website with thousands of documents in a collection becomes unmanageable if all documents are stored in the same folder, potentially exceeding the maximum number of files per folder allowed by the operating system.
To avoid this issue, subfolders are created within the main collection folder. The idea is to have a system that automatically creates the folder structure where the newly created document will be placed, based on the file name, similar to the "filePrefix" property but for automatically and configurable directory creation.
Proposed Solution:
Create a configuration parameter "subdir" where a template using placeholders can be configured.
For example, with this configuration:
When creating a document titled "post," it would be generated in the folder "/src/content/blog/2024/06/post.md".
Additionally, it should be possible to use custom placeholders. For example, creating a placeholder that returns the first few characters of the title as a directory.
We would create a script associated with the "customPlaceholder" that generates directories from the first few numbers: customPlaceholder(15678) => "1/5/6/7/".
So, if we created a document titled "345," it would be generated in the folder "/src/content/blog/3/4/345.md".
The text was updated successfully, but these errors were encountered: