Closed jaswrks closed 9 years ago
Suggested directory structure for large KB repos.
You could also just start with putting articles in questions/2015/
and then if you find the number of articles at some point that year approaching 1000, start putting them in a new sub-directory for the current month. That's what I'd do if I didn't feel it it was likely that a particular site was going to hit 1000 articles that year.
That strategy would allow for long-term growth of a KB, as you'd be able to separate the articles into year sub-directories without immediately going to the year/month/ level.
Agree, that seems easier.
A fork of: https://github.com/websharks/wp-kb-articles/issues/12#issuecomment-76542204
Important Note
While WPKBA now supports an unlimited number of files/directories, there is an important issue worth noting about the GitHub API. It pertains to the max number of items in any given directory tree.
Any tree that contains more than 1000 items is going to create a problem. You can have two gazillion directories with 1000 items each. However, if you have 1 directory with 1001 items this will cause an issue, because any single API call to retrieve a tree will return at most 1000 items.
For that reason, it is suggested that you use date-based subdirectories to prevent any single tree from containing more than 1000 items. 1000 being the most that a single API call will return.
The limit of 1000 is per-directory (i.e., tree) and not a total for all subdirectories. In other words, you can have one folder with 1000 subfolders, each with 1000 more subfolders, each with 1000 files. The key is that you don't allow more than 1000 sub-directories or files inside any given directory, regardless of it's depth.
To clarify further, a "tree" is a directory (regardless of it's depth). Each tree returns a list of items that consist of other trees (subdirectories), or files inside the tree. Trees can be nested as deep as you like, in any quantity that you like. However, there can never be more than 1000 items in any given tree.
That means that even the following directory structure may eventually hit a limit over time:
In this example,
tutorials
is a tree,0101
is another tree, and0102
is another tree. Each of these can contain up to 1000 items each (i.e., subdirectories or files).@raamdev writes...
@jaswsinc writes...