Skip to content

Commit f5dbe7f

Browse files
committed
docs: update ordering files
closes #3087
1 parent 4e8cf05 commit f5dbe7f

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

docs/content/docs/1.getting-started/4.migration.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ The new API is backed by SQL and content queries happens within a specific colle
4646
- Document `._path` is now renamed to `.path`, likewise all internal fields with `_` prefix are removed or renamed.
4747
- `useContentHelpers()` is removed
4848
- Module does not ignore dot files by default, you can ignore them by adding `ignore: ['**/.*']` in `exclude` options of your collection source.
49+
- Due to SQL limitations, sort order now uses alphabetical order instead for numerical order. Check out the [Ordering Files](/docs/collections/types#ordering-files) section for more information.
4950

5051
### Nuxt Studio integration
5152

docs/content/docs/2.collections/2.types.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,23 @@ There’s no strict relationship between collection type and file extension. For
113113

114114
For both types, you may want to control the display order in lists. Use numeric prefixes in file and directory names to specify an order. Nuxt Content will use these numbers when ordering content lists.
115115

116+
::note
117+
Nuxt Content uses alphabetical order for sorting, so if you want to use numerical order, you need to prefix single digit numbers with `0`. For example, without the `0` prefix, `10.foo.md` would come before `2.bar.md`.
118+
::
119+
116120
```text [Directory structure]
117121
content/
118122
1.frameworks/
119123
1.vue.md
120124
2.nuxt.md
125+
...
121126
2.examples/
122-
1.vercel.md
123-
2.netlify.md
124-
3.heroku.md
127+
01.nuxthub.md
128+
02.vercel.md
129+
03.netlify.md
130+
04.heroku.md
131+
...
132+
10.cloudflare.md
125133
index.md
126134
```
127135

0 commit comments

Comments
 (0)