Skip to content

Commit 3d43460

Browse files
committed
Improve sidebar wrapping and GitHub link
1 parent b1200ea commit 3d43460

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

docs/.vitepress/config.mts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { withMermaid } from "vitepress-plugin-mermaid";
44

55
const docsBase = "/learn-harness-engineering/";
66
const brandLogo = 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23D95C41" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><line x1="12.1" y1="11.9" x2="18.9" y2="8.2" /><line x1="12.1" y1="12.1" x2="20.3" y2="12.9" /><line x1="12.2" y1="12.4" x2="16.6" y2="19.1" /><line x1="11.8" y1="12.4" x2="7.3" y2="19.2" /><line x1="11.9" y1="12.1" x2="3.7" y2="13.3" /><line x1="11.8" y1="11.7" x2="7.8" y2="4.4" /></svg>';
7+
const githubRepoTreeLink = "https://github.com/walkinglabs/learn-harness-engineering/tree/main";
78

89
const zhLectureItems = [
910
{ text: "欢迎", link: "/zh/" },
@@ -92,7 +93,7 @@ export default withMermaid(
9293
search: {
9394
provider: "local"
9495
},
95-
socialLinks: [{ icon: "github", link: "https://github.com/walkinglabs/learn-harness-engineering" }]
96+
socialLinks: [{ icon: "github", link: githubRepoTreeLink }]
9697
},
9798
markdown: {
9899
theme: {
@@ -132,7 +133,7 @@ export default withMermaid(
132133
'/en/resources/': [{ text: "Resource Library", items: enResourceItems }],
133134
'/en/': [{ text: "Lectures", items: enLectureItems }]
134135
},
135-
socialLinks: [{ icon: "github", link: "https://github.com/walkinglabs/learn-harness-engineering" }]
136+
socialLinks: [{ icon: "github", link: githubRepoTreeLink }]
136137
}
137138
},
138139
zh: {
@@ -166,7 +167,7 @@ export default withMermaid(
166167
darkModeSwitchLabel: "主题",
167168
lightModeSwitchTitle: "切换到浅色模式",
168169
darkModeSwitchTitle: "切换到深色模式",
169-
socialLinks: [{ icon: "github", link: "https://github.com/walkinglabs/learn-harness-engineering" }]
170+
socialLinks: [{ icon: "github", link: githubRepoTreeLink }]
170171
}
171172
}
172173
}

docs/.vitepress/theme/style.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
--vp-c-brand-soft: rgba(217, 92, 65, 0.1);
2121

2222
/* Sidebar */
23+
--vp-sidebar-width: 296px;
2324
--vp-sidebar-bg-color: #F4F3EE;
2425
--vp-c-divider: rgba(0, 0, 0, 0.08);
2526

@@ -210,6 +211,9 @@
210211

211212
/* ---------- Sidebar ---------- */
212213
.VPSidebar {
214+
width: min(360px, calc(100vw - 24px));
215+
max-width: calc(100vw - 24px);
216+
padding: 28px 24px 96px;
213217
background-color: var(--vp-sidebar-bg-color) !important;
214218
border-right: 1px solid var(--vp-c-divider) !important;
215219
}
@@ -222,6 +226,7 @@
222226

223227
.VPSidebar .VPSidebarItem .item .link {
224228
position: relative;
229+
align-items: flex-start;
225230
border-radius: 8px !important;
226231
transition: background-color 0.2s, color 0.2s;
227232
color: var(--vp-c-text-2) !important;
@@ -230,6 +235,12 @@
230235
margin: 2px 0;
231236
}
232237

238+
.VPSidebar .VPSidebarItem .item .text {
239+
line-height: 1.55;
240+
text-wrap: pretty;
241+
line-break: loose;
242+
}
243+
233244
.VPSidebar .VPSidebarItem .item .link:hover {
234245
color: var(--vp-c-text-1) !important;
235246
background-color: rgba(0, 0, 0, 0.04) !important;

0 commit comments

Comments
 (0)