We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reproduced under WSL and native Windows.
Create a new content app with npx nuxi@latest init content-app -t content, then add a index.vue in the pages root with this content:
npx nuxi@latest init content-app -t content
<template> <ul> <li v-for="article of articles" v:key="article._path">{{article._path }}</li> </ul> </template> <script setup> const { data: articles } = await useAsyncData(() => queryContent('articles').find()) </script>
Then finally create the following in the content folder (they can be just empty files):
Now running the page you'd expect to see just 1 item, "/articles/welcome-to-the-blog` based on the documentation for queryContent given that https://content.nuxt.com/composables/query-content says:
// Create a query looking into content/articles directory const contentQuery = queryContent('articles')
But in fact you get two results:
queryContent arguments are matching against start of the path and not actually by directory name - in contradiction to the docs.
The fix will either be:
queryContent('articles/')
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Environment
Reproduced under WSL and native Windows.
Reproduction
Create a new content app with
npx nuxi@latest init content-app -t content
, then add a index.vue in the pages root with this content:Then finally create the following in the content folder (they can be just empty files):
Now running the page you'd expect to see just 1 item, "/articles/welcome-to-the-blog` based on the documentation for queryContent given that https://content.nuxt.com/composables/query-content says:
But in fact you get two results:
Describe the bug
queryContent arguments are matching against start of the path and not actually by directory name - in contradiction to the docs.
The fix will either be:
queryContent('articles/')
(trailing slash)Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: