Open gitFoxCode opened 1 year ago
You can simply download all files using /
inside the queryContent
, and then continuing in the same chain, you can use Content Module's where
option to actually pick up only those two folders (blog, news).
This will be efficient compared to using normal JS filter
.
You can use regex to fetch both directories:
const news = await queryContent().where({ _path: /^\/(news|blog)\// }).find()
You can use regex to fetch both directories:
const news = await queryContent().where({ _path: /^\/(news|blog)\// }).find()
Ok, and how could I sort the items the way I wanted with this? Because currently they behave "separately"
/news
1.test.md
3.article.md
/blog
2.blog-article.md
Now its:
test, article, blog-article
I want:
test, blog-article, article
@gitFoxCode Sort by slug, rather than path.
@gitFoxCode Sort by slug, rather than path.
Can also be sorted according to preference. Depending on various properties, such as categories or similar.
Is your feature request related to a problem? Please describe
I would like to download all articles, which unfortunately I have in two separate folders. To do this currently I have to download them individually and merge, or download everything from
/
and filter, which is not efficient. In the documentation is written out the possibility of using something like this:I don't think it would be useful, after all, you can use just
It would be better to turn this into an option to download from multiple paths simultaneously
Describe the solution you'd like
The solution I would like is to be able to insert an array in the queryContent:
Describe alternatives you've considered
Additional context