Skip to content

Commit 594d8dd

Browse files
authored
chore: enforce toc when no section top-level content (#376)
# Description When there is no content specified in a `README.mdx` / `README.md` within a folder, this creates a "category" in Docusaurus, and, if there is children content, this will just appear as navigation items under the folder's name as a new Section (i.e. there is no TOC, and no specific page for that folder / section when selected). This causes issues, such as when wanting to refer users to "all order types" (see https://docs.cow.fi/category/concepts and try to click 'Order Types'). It's a common request to be asked what order types are supported, and not having a section that contains this in a snapshot makes the documentation difficult to navigate / cumbersome. # Changes - [x] All sections that do not have a `README.mdx` / `README.md` (i.e. no top level content), now have an auto-generated table of contents.
1 parent 6fc4097 commit 594d8dd

File tree

33 files changed

+117
-78
lines changed

33 files changed

+117
-78
lines changed

docs/cow-protocol/_category_.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,5 @@
22
"position": 2,
33
"label": "🐮 CoW Protocol",
44
"collapsible": true,
5-
"collapsed": true,
6-
"customProps": {
7-
"description": "This is the CoW Protocol section."
8-
}
5+
"collapsed": true
96
}

docs/cow-protocol/concepts/_category_.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
"collapsible": true,
55
"collapsed": true,
66
"link": {
7-
"type": "generated-index",
8-
"title": "Concepts"
9-
},
10-
"customProps": {
11-
"description": "This is the concepts section."
7+
"type": "generated-index"
128
}
139
}
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
{
22
"position": 4,
3-
"label": "Benefits"
4-
}
3+
"label": "Benefits",
4+
"collapsible": true,
5+
"collapsed": true,
6+
"link": {
7+
"type": "generated-index"
8+
}
9+
}
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
{
22
"position": 2,
3-
"label": "How it works"
4-
}
3+
"label": "How it works",
4+
"collapsible": true,
5+
"collapsed": true,
6+
"link": {
7+
"type": "generated-index"
8+
}
9+
}
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
{
22
"position": 1,
3-
"label": "Introduction"
4-
}
3+
"label": "Introduction",
4+
"collapsible": true,
5+
"collapsed": true,
6+
"link": {
7+
"type": "generated-index"
8+
}
9+
}
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
{
22
"position": 3,
3-
"label": "Order types"
4-
}
3+
"label": "Order types",
4+
"collapsible": true,
5+
"collapsed": true,
6+
"link": {
7+
"type": "generated-index"
8+
}
9+
}

docs/cow-protocol/reference/_category_.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
"collapsible": true,
55
"collapsed": true,
66
"link": {
7-
"type": "generated-index",
8-
"title": "Technical reference"
9-
},
10-
"customProps": {
11-
"description": "This is the technical reference section."
7+
"type": "generated-index"
128
}
139
}
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
{
22
"label": "APIs",
3-
"position": 6
4-
}
3+
"position": 6,
4+
"collapsible": true,
5+
"collapsed": true,
6+
"link": {
7+
"type": "generated-index"
8+
}
9+
}
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
{
22
"position": 6,
3-
"label": "Contracts"
4-
}
3+
"label": "Contracts",
4+
"collapsible": true,
5+
"collapsed": true,
6+
"link": {
7+
"type": "generated-index"
8+
}
9+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
22
"position": 1
3-
}
3+
}

0 commit comments

Comments
 (0)