@alauda/doom 1.7.1 → 1.8.0

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/lib/theme.js CHANGED
@@ -13,6 +13,9 @@ const X = getCustomMDXComponent();
13
13
  const getClosestSidebar_ = (sidebarItems, pathname, exportItem, matched, depth = 0) => {
14
14
  for (const sidebar of sidebarItems) {
15
15
  if ('_fileKey' in sidebar && sidebar._fileKey) {
16
+ if (depth === 0) {
17
+ matched = undefined;
18
+ }
16
19
  if (exportItem.entry.includes(sidebar._fileKey)) {
17
20
  matched = {
18
21
  sidebar,
@@ -26,7 +29,7 @@ const getClosestSidebar_ = (sidebarItems, pathname, exportItem, matched, depth =
26
29
  }
27
30
  }
28
31
  if ('items' in sidebar) {
29
- const found = getClosestSidebar_(sidebar.items, pathname, exportItem, matched);
32
+ const found = getClosestSidebar_(sidebar.items, pathname, exportItem, matched, depth + 1);
30
33
  if (found) {
31
34
  return found;
32
35
  }
@@ -56,9 +59,13 @@ export const Layout = () => {
56
59
  return;
57
60
  }
58
61
  if (themeConfig.locales?.length) {
62
+ let found;
59
63
  for (const { lang, sidebar } of themeConfig.locales) {
60
64
  const sidebarItems = sidebar[siteLang === lang ? '/' : `/${lang}`];
61
- return getClosestSidebar(sidebarItems, pathname);
65
+ found ??= getClosestSidebar(sidebarItems, pathname);
66
+ if (found) {
67
+ return found;
68
+ }
62
69
  }
63
70
  }
64
71
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alauda/doom",
3
- "version": "1.7.1",
3
+ "version": "1.8.0",
4
4
  "type": "module",
5
5
  "description": "Doctor Doom making docs.",
6
6
  "repository": "git+https://github.com/alauda/doom.git",
@@ -54,7 +54,7 @@ td {
54
54
  margin-left: 4px;
55
55
  }
56
56
 
57
- .has-callouts .rspress-code-content {
57
+ .has-callouts {
58
58
  counter-reset: callouts;
59
59
 
60
60
  .line.callout {
@@ -145,3 +145,14 @@ td {
145
145
  @media print {
146
146
  @include print;
147
147
  }
148
+
149
+ .rp-list-decimal {
150
+ list-style: none;
151
+ counter-reset: section;
152
+ padding-left: 20px;
153
+ }
154
+
155
+ .rp-list-decimal > li:before {
156
+ counter-increment: section;
157
+ content: counters(section, '.') '. ';
158
+ }