How to exclude/ignore README.md from $content() fetches?
See original GitHub issueI’m wondering if I can tell @nuxt/content to ignore README files when “fetching” data in a cms like manner.
this.$content('menues')
and http://localhost:3030/_content/menues
both also return the README.md
in ~/content/menues/
I don’t want that. I’d like to exclude README files in general for all content fetches.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How can I test what my readme.md file will look like before ...
File extension is .md so you can preview your changes. You will update util you finish, then copy the file content and paste...
Read more >gitignore Documentation - Git
A gitignore file specifies intentionally untracked files that Git should ignore. Files already tracked by Git are not affected; see the NOTES below...
Read more >How to Create a Self-Updating README.md for Your GitHub ...
In this ./workflows folder, create a ./main.yaml file that will hold our Action. $ cd ./workflows && touch main.yaml. Fill it with this...
Read more >How I Built A Self-Updating README On My Github Profile
GitHub profile READMEs are a new feature that allows users to have the content of a README markdown file rendered at the profile...
Read more >Static Readme Regeneration - Aral Roca
This file will contain all the static content of the README.md . ... Fetch all articles of my blog on rss.xml fn get_blog_rss()...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think we should ignore all files and directories starting by
_
and also respecting Nuxt ignore pattern.This way you could have
content/_README.md
to directly setcontent/**/README.md
in.nuxtignore
@katerlouis
where()
query-building method is for you (doc).Each file name is used as a built-in
slug
property of document in database (doc), which means it can be filtered out bywhere()
method like the following:If you want to fetch all the
README.md
files only from all the sub directories, you can also do it:JFYI:
Actually, you can chain query-building methods before calling
fetch()
, so that you can fetch only documents which match all the queries built in the chain.For example, here is how Theme Docs fetches prev/next documents of the current page’s document (code):