Replies: 1 comment
-
My solution was to first query all the paths that contain '/cities' and then filter out those that have two slashes in them 😌 This would give a list of sub folders that can be looped without -component const cityQuery = await queryContent({
where: {
_path: {$contains: '/cities'},
}
}).find();
// Filter out non-cities and paths that are not direct children of root
let cityList = cityQuery.filter((item) => {
return item._path.split('/').length === 2;
}); <div v-for="city in cityList" :key="city._path">
{{city.title}}
</div> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello there,
given this directory structure:
I'd like to get a sort of "overview over all folders containing contents".
In this case the result should be:
folder-1
folder-2
But not
index.md
,bar.md
or_dir.yml
.As I am using the document driven approach, I was thinking about using this approach:
But I did not find anything about a possibility to filter partials and limit depth.
Any help is highly appreciated :-)
Beta Was this translation helpful? Give feedback.
All reactions