@primer/doctocat-nextjs 0.0.0-20250624173343 → 0.0.0-20250624182848
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
# @primer/doctocat-nextjs
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-20250624182848
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- Fake entry to force publishing
|
|
8
8
|
|
|
9
|
-
## 0.0.0-
|
|
9
|
+
## 0.0.0-20250624182846
|
|
10
10
|
|
|
11
11
|
### Patch Changes
|
|
12
12
|
|
|
13
|
-
- [
|
|
14
|
-
- Increased spacing below React code blocks, which was previously too small.
|
|
13
|
+
- [`816b6a5`](https://github.com/primer/doctocat-nextjs/commit/816b6a5af42f0c6e4ff7ae5473440e153f0df600) Thanks [@rezrah](https://github.com/rezrah)! - Add `menu-position` frontmatter support for custom sidebar navigation ordering
|
|
15
14
|
|
|
16
15
|
## 0.5.3
|
|
17
16
|
|
|
@@ -82,7 +82,29 @@ export function Sidebar({pageMap}: SidebarProps) {
|
|
|
82
82
|
<NextLink href={item.route}>{subNavName}</NextLink>
|
|
83
83
|
</NavList.GroupHeading>
|
|
84
84
|
{item.children
|
|
85
|
-
.sort((a, b) =>
|
|
85
|
+
.sort((a, b) => {
|
|
86
|
+
// make sure index page is first
|
|
87
|
+
if ((a as MdxFile).name === 'index') return -1
|
|
88
|
+
if ((b as MdxFile).name === 'index') return 1
|
|
89
|
+
|
|
90
|
+
// Check for menu-position property in frontmatter
|
|
91
|
+
const aPos = (a as MdxFile).frontMatter?.['menu-position']
|
|
92
|
+
const bPos = (b as MdxFile).frontMatter?.['menu-position']
|
|
93
|
+
|
|
94
|
+
// If both have menu-position, sort by menu-position
|
|
95
|
+
if (typeof aPos === 'number' && typeof bPos === 'number') {
|
|
96
|
+
return aPos - bPos
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// If only one has menu-position, it comes first
|
|
100
|
+
if (typeof aPos === 'number') return -1
|
|
101
|
+
if (typeof bPos === 'number') return 1
|
|
102
|
+
|
|
103
|
+
// Neither has menu-position, sort alphabetically by title or name
|
|
104
|
+
const aTitle = (a as MdxFile).frontMatter?.title || (a as MdxFile).name
|
|
105
|
+
const bTitle = (b as MdxFile).frontMatter?.title || (b as MdxFile).name
|
|
106
|
+
return aTitle.localeCompare(bTitle)
|
|
107
|
+
})
|
|
86
108
|
// only show index page if it has show-tabs
|
|
87
109
|
.filter(child => (child as MdxFile).name !== 'index' || hasShowTabs(child as ExtendedPageItem))
|
|
88
110
|
.map(child => {
|
package/css/prose.module.css
CHANGED
|
@@ -211,11 +211,6 @@
|
|
|
211
211
|
background-color: var(--base-color-scale-indigo-0);
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
/* Inline code inside headings should inherit font-size */
|
|
215
|
-
.Prose :is(h1, h2, h3, h4, h5, h6):has(code) code:not(:global(.custom-component) code) {
|
|
216
|
-
font-size: inherit;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
214
|
[data-color-mode='dark'] .Prose code:not(:global(.custom-component) code) {
|
|
220
215
|
background-color: var(--base-color-scale-indigo-9);
|
|
221
216
|
}
|
package/package.json
CHANGED