@rspress-theme-anatole/theme-default 0.6.8 → 0.6.9
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/dist/bundle.js +13 -1
- package/package.json +3 -3
package/dist/bundle.js
CHANGED
|
@@ -1147,7 +1147,7 @@ function DocLayout(props) {
|
|
|
1147
1147
|
const { headingTitle, title, toc = [], frontmatter, routePath } = page;
|
|
1148
1148
|
const [tabData, setTabData] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)({});
|
|
1149
1149
|
const headers = toc;
|
|
1150
|
-
const { themeConfig, base } = siteData;
|
|
1150
|
+
const { themeConfig, base, lang } = siteData;
|
|
1151
1151
|
const enableScrollToTop = themeConfig.enableScrollToTop ?? false;
|
|
1152
1152
|
const localesData = useLocaleSiteData();
|
|
1153
1153
|
const outlineTitle = localesData?.outlineTitle || themeConfig?.outlineTitle || 'ON THIS PAGE';
|
|
@@ -1204,6 +1204,14 @@ function DocLayout(props) {
|
|
|
1204
1204
|
|
|
1205
1205
|
const breadcrumb = findActiveBreadcrumb(sidebarData, activeMatcher) || [];
|
|
1206
1206
|
|
|
1207
|
+
// 判断 str 是否以 prefix 开头,如果是则移除 prefix
|
|
1208
|
+
function removePrefix(str, prefix) {
|
|
1209
|
+
if (str.startsWith(prefix)) {
|
|
1210
|
+
return str.slice(prefix.length);
|
|
1211
|
+
}
|
|
1212
|
+
return str;
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1207
1215
|
const breadcrumbNav = breadcrumb.map((item, idx) => {
|
|
1208
1216
|
const normalizedBase = base.endsWith('/') ? base.slice(0, -1) : base;
|
|
1209
1217
|
|
|
@@ -1237,6 +1245,10 @@ function DocLayout(props) {
|
|
|
1237
1245
|
window.location.href = normalizedBase + item.link + '.html';
|
|
1238
1246
|
return;
|
|
1239
1247
|
} else {
|
|
1248
|
+
if (lang && item.key.startsWith(`${lang}/`)) {
|
|
1249
|
+
//只移除最开头的lang
|
|
1250
|
+
item.key = removePrefix(item.key, `${lang}`);
|
|
1251
|
+
}
|
|
1240
1252
|
// 父级不可点击,跳转到当前级别下的第一个子节点页面
|
|
1241
1253
|
window.location.href = normalizedBase + (item.key.startsWith('/') ? item.key : `/${item.key}`) + '.html';
|
|
1242
1254
|
return;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspress-theme-anatole/theme-default",
|
|
3
3
|
"author": "Anatole Tong",
|
|
4
|
-
"version": "0.6.
|
|
4
|
+
"version": "0.6.9",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"*.css",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"types": "./dist/bundle.d.ts",
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@mdx-js/react": "2.3.0",
|
|
24
|
-
"@rspress-theme-anatole/rspress-plugin-mermaid": "0.6.
|
|
25
|
-
"@rspress-theme-anatole/shared": "0.6.
|
|
24
|
+
"@rspress-theme-anatole/rspress-plugin-mermaid": "0.6.9",
|
|
25
|
+
"@rspress-theme-anatole/shared": "0.6.9",
|
|
26
26
|
"@rspress/runtime": "1.43.8",
|
|
27
27
|
"body-scroll-lock": "4.0.0-beta.0",
|
|
28
28
|
"copy-to-clipboard": "^3.3.3",
|