Skip to content

Commit d8132e4

Browse files
authored
feat: Add tutorial videos dropdown in sidebar with direct YouTube links (#265)
1 parent 6c9f346 commit d8132e4

File tree

3 files changed

+76
-10
lines changed

3 files changed

+76
-10
lines changed

docs/tutorial-videos.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,43 @@
22
"videos": [
33
{
44
"id": "Mcq3r1EPZ-4",
5-
"title": "Installing Roo Code in VS Code"
5+
"title": "Installing Roo Code"
66
},
77
{
88
"id": "eEJErgZBqLE",
9-
"title": "Configuring Profiles | Detailed Tutorial"
9+
"title": "Configuring Profiles"
1010
},
1111
{
1212
"id": "QDy3dm1xJ6Y",
13-
"title": "Setting up MCP server in Roo"
13+
"title": "Setting up MCP Servers"
1414
},
1515
{
1616
"id": "jW4_PPyRXCs",
17-
"title": "Auto Approve in Roo Code Explained | Detailed Tutorial"
17+
"title": "Auto Approve Feature"
1818
},
1919
{
2020
"id": "qgqceCuhlRA",
21-
"title": "Custom Modes in Roo Code | Official Tutorial "
21+
"title": "Custom Modes"
2222
},
2323
{
2424
"id": "Ho30nyY332E",
25-
"title": "Checkpoints in Roo Code | Official Tutorial"
25+
"title": "Checkpoints"
2626
},
2727
{
2828
"id": "r1bpod1VWhg",
29-
"title": "Codebase Indexing Setup Tutorial"
29+
"title": "Codebase Indexing"
3030
},
3131
{
3232
"id": "9k8OAXlszak",
33-
"title": "Context Condensing Tutorial"
33+
"title": "Context Condensing"
3434
},
3535
{
3636
"id": "WatooxMlW0U",
3737
"title": "Roo Marketplace"
3838
},
3939
{
4040
"id": "6h5vB9PpoPk",
41-
"title": "Roo Code Todo Lists"
41+
"title": "Todo Lists"
4242
}
4343
]
4444
}

sidebars.ts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
import type {SidebarsConfig} from '@docusaurus/plugin-content-docs';
2+
import tutorialVideos from './docs/tutorial-videos.json';
3+
4+
// Helper function to truncate long titles
5+
function truncateTitle(title: string, maxLength: number = 40): string {
6+
if (title.length <= maxLength) return title;
7+
return title.substring(0, maxLength - 3) + '...';
8+
}
29

310
const sidebars: SidebarsConfig = {
411
tutorialSidebar: [
@@ -18,6 +25,23 @@ const sidebars: SidebarsConfig = {
1825
'tips-and-tricks',
1926
],
2027
},
28+
{
29+
type: 'category',
30+
label: 'Tutorial Videos',
31+
items: [
32+
{
33+
type: 'doc',
34+
id: 'tutorial-videos',
35+
label: 'All Videos',
36+
},
37+
...tutorialVideos.videos.map((video) => ({
38+
type: 'link' as const,
39+
label: truncateTitle(video.title),
40+
href: `https://www.youtube.com/watch?v=${video.id}`,
41+
description: video.title.length > 40 ? video.title : undefined,
42+
})),
43+
],
44+
},
2145
{
2246
type: 'category',
2347
label: 'Roo Code Cloud',
@@ -158,7 +182,6 @@ const sidebars: SidebarsConfig = {
158182
'faq',
159183
],
160184
},
161-
'tutorial-videos',
162185
{
163186
type: 'link',
164187
label: 'Contributing (GitHub)',

src/css/custom.css

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2289,4 +2289,47 @@ html {
22892289
.footer__links-wrapper {
22902290
margin-top: 0;
22912291
}
2292+
}
2293+
2294+
/* ============================================
2295+
CUSTOM TUTORIAL VIDEOS SIDEBAR STYLES
2296+
============================================ */
2297+
2298+
/* Move external link icons to the right for Tutorial Videos */
2299+
.menu__list-item a[href^="https://www.youtube.com/watch"] {
2300+
display: flex !important;
2301+
justify-content: space-between !important;
2302+
align-items: center !important;
2303+
padding-right: 0.5rem !important;
2304+
width: 100% !important;
2305+
}
2306+
2307+
/* Ensure the link text takes up available space */
2308+
.menu__list-item a[href^="https://www.youtube.com/watch"] .menu__link-text {
2309+
flex: 1 !important;
2310+
overflow: hidden !important;
2311+
text-overflow: ellipsis !important;
2312+
white-space: nowrap !important;
2313+
margin-right: 0.5rem !important;
2314+
}
2315+
2316+
/* Move the external link icon (svg) to the right */
2317+
.menu__list-item a[href^="https://www.youtube.com/watch"] svg {
2318+
order: 2 !important;
2319+
margin-left: auto !important;
2320+
margin-right: 0 !important;
2321+
flex-shrink: 0 !important;
2322+
width: 13px !important;
2323+
height: 13px !important;
2324+
opacity: 0.6 !important;
2325+
}
2326+
2327+
/* Show icon more prominently on hover */
2328+
.menu__list-item a[href^="https://www.youtube.com/watch"]:hover svg {
2329+
opacity: 1 !important;
2330+
}
2331+
2332+
/* Ensure consistent spacing for all tutorial video links */
2333+
.menu__list-item:has(> a[href^="https://www.youtube.com/watch"]) {
2334+
margin-bottom: 0 !important;
22922335
}

0 commit comments

Comments
 (0)