Skip to content

Commit ccef367

Browse files
authored
doc: fix sort order + snipsync examples issue (#1341)
1 parent 80fd40b commit ccef367

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

packages/docs/docusaurus.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ module.exports = {
129129
excludeProtected: true,
130130
hideGenerator: true,
131131
disableSources: true,
132+
jsDocCompatibility: {
133+
exampleTag: false,
134+
},
132135
readme: 'none',
133136
watch,
134137
frontmatter: {

packages/docs/sidebars.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ function titleCase(str) {
1111

1212
function nestMarkdownFiles() {
1313
return markdownFiles()
14+
.sort()
1415
.sort((a, b) => a.split('.').length - b.split('.').length)
1516
.reduce((acc, f) => {
1617
const url = path.relative(path.join(__dirname, 'docs'), f).replace(/\.md$/, '');
@@ -24,7 +25,7 @@ function nestMarkdownFiles() {
2425
type: 'category',
2526
label: basename,
2627
link: { type: 'doc', id: `api/namespaces/${basename}` },
27-
items: [url],
28+
items: [],
2829
},
2930
];
3031
}
@@ -35,7 +36,12 @@ function nestMarkdownFiles() {
3536

3637
// Insert new item
3738
if (category === 'Namespaces') {
38-
items.push({ type: 'category', label: url.replace(/.*\./, ''), items: [url] });
39+
items.push({
40+
type: 'category',
41+
label: url.replace(/.*\./, ''),
42+
link: { type: 'doc', id: `api/namespaces/${basename}` },
43+
items: [],
44+
});
3945
} else {
4046
let item = items.find(({ label }) => label === category);
4147
if (item === undefined) {

0 commit comments

Comments
 (0)