Skip to content

Commit 0dd531a

Browse files
authored
fix(doc-core): sidebar link i18n (#3731)
* fix: sidebar link i18n * feat: add icon lark
1 parent 43b4e83 commit 0dd531a

File tree

6 files changed

+23
-2
lines changed

6 files changed

+23
-2
lines changed

.changeset/nasty-cougars-try.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@modern-js/doc-core': patch
3+
---
4+
5+
fix(doc-core): sidebar link i18n
6+
7+
fix(doc-core): 修复侧边栏链接国际化问题

packages/cli/doc-core/src/node/runtimeModule/siteData.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,11 @@ export function normalizeThemeConfig(
125125
}
126126

127127
return {
128-
...item,
129128
text: applyReplaceRules(
130129
getI18nText(item.text, currentLang),
131130
replaceRules,
132131
),
132+
link: normalizeLangPrefix(item.link, currentLang),
133133
};
134134
};
135135
Object.keys(sidebar).forEach(key => {

packages/cli/doc-core/src/theme-default/components/SocialLinks/index.module.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
display: flex;
55
fill: currentColor;
66
margin-left: 0.5rem;
7-
margin-right: 0.5rem;
87
color: var(--modern-c-text-2);
98

109
&:hover {

packages/cli/doc-core/src/theme-default/components/SocialLinks/presetIcons.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,4 +152,17 @@ export default {
152152
></path>
153153
</svg>
154154
),
155+
lark: (
156+
<svg
157+
xmlns="http://www.w3.org/2000/svg"
158+
width="48"
159+
height="48"
160+
viewBox="0 0 48 48"
161+
>
162+
<g fillRule="evenodd" clipRule="evenodd">
163+
<path d="M41.0716 5.99409L3.31071 16.5187L12.3856 25.8126L20.7998 25.9594L30.4827 16.5187C30.2266 15.9943 30.0985 15.5552 30.0985 15.2013C30.0985 14.4074 30.4104 13.7786 30.8947 13.333C31.7241 12.57 32.7222 12.4558 33.8889 12.9905L41.0716 5.99409Z" />
164+
<path d="M42.1021 6.72842L31.5775 44.4893L22.2836 35.4144L22.1367 27.0002L31.5115 17.4816C32.0195 17.8454 32.5743 18.0105 33.1759 17.9769C34.0784 17.9264 34.6614 17.3813 34.9349 17.0602C35.2083 16.7392 35.5293 16.2051 35.5025 15.4113C35.4847 14.8821 35.3109 14.3941 34.9812 13.9472L42.1021 6.72842Z" />
165+
</g>
166+
</svg>
167+
),
155168
};

packages/document/doc-tools-doc/docs/en/api/config-theme.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ Related links support the following types of images, which can be selected throu
354354

355355
```ts
356356
export type SocialLinkIcon =
357+
| 'lark'
357358
| 'discord'
358359
| 'facebook'
359360
| 'github'

packages/document/doc-tools-doc/docs/zh/api/config-theme.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ export default defineConfig({
340340

341341
```ts
342342
export type SocialLinkIcon =
343+
| 'lark'
343344
| 'discord'
344345
| 'facebook'
345346
| 'github'

0 commit comments

Comments
 (0)