[Feature Request] Get content of subdirectories also
See original GitHub issueFeature Idea
When fetching a content from a directory it would be awesome to have the content from the sub directories listed as well.
Expected behaviour
-| content/
---| articles/
------| article.md
------| new/
---------| inside-new.md
Current with the directory tree as above if I fetch the content as
await this.$content('articles').fetch()
only article
is in the response. It would be awesome to have the content from subdirectory of articles, in this case new
would be fetched as well.
i.e. article
and inside-new
would all be in the resposne after fetch.
Possible solution
I agree not everyone would love to have this behavious by default. So I thought of two possible solutions to have this feature and also keep the current behavious
1. Pass a boolean parameter to .fetch()
method, depending on which the subdirectory will be or won’t be fetched… Default can be false for the compatibility with current bahaviour.
2. Add a new method which acts just like fetch but gets content from subdirectories as well… something like .fetchDeep()
or anything that makes sense.
Other stuffs
I am loving this module a lot. It makes lots of things really easier compared to how annoying they were earlier. Regarding the feature request, that is just my idea. I would love to know if that would not be possible or won’t be implemented.
❤️ Nuxt.js
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:8 (3 by maintainers)
Top GitHub Comments
Hey @TheLearneer,
We’ve taken into account this feature already and will be working on it soon 😃.
Is should be more like:
@mathieunicolas This feature has been released in v1.3.0!