nuxt / content

The file-based CMS for your Nuxt application, powered by Markdown and Vue components.
https://content.nuxt.com
MIT License
3.08k stars 624 forks source link

Possibility to order the result of fetchContentNavigation() #2456

Closed idesignzone closed 8 months ago

idesignzone commented 9 months ago

I am trying to create a website menu using the navigation. When I use fetchContentNavigation(), it returns the title and the path of each item but there is no way to order the result. Consider for example a "Home" item in a website menu must be always the first in the list.

image
nobkd commented 9 months ago

You can prefix your files with numbers to set an order: https://content.nuxt.com/usage/content-directory#ordering

This should just be used by fetchContentNavigation.

If you want to insert pages later, you can just leave a range of numbers blank to be able to add pages within.