Skip to content

Commit faed0f1

Browse files
committed
changes for truncating cards on the workflow cards
1 parent 33fcb5f commit faed0f1

4 files changed

Lines changed: 99 additions & 13 deletions

File tree

.claude/settings.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@
1818
"Bash(pkill -f build_daemon)",
1919
"Bash(pkill -f dart.*build_runner)",
2020
"Bash(curl -s http://localhost:4000/docs/overview/)",
21-
"mcp__plugin_wingspan_dart__dart_fix"
21+
"mcp__plugin_wingspan_dart__dart_fix",
22+
"Bash(node capture.js --url=\"http://localhost:4000/docs/workflows\" --name=\"docs-workflows\" --width=1200)",
23+
"Bash(node capture.mjs --url=\"http://localhost:3000/docs/workflows\" --name=\"docs-workflows\" --width=1200)",
24+
"Bash(node capture.mjs --url=\"http://localhost:4000/docs/workflows\" --name=\"docs-workflows\" --width=1200)"
2225
]
2326
}
2427
}

JASPR_MIGRATION.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Migrating from Docusaurus to Jaspr
2+
3+
## 1. Scaffold the Jaspr project
4+
5+
```bash
6+
dart pub global activate jaspr_cli
7+
jaspr create --template=docs site_jaspr
8+
```
9+
10+
This gives you a Jaspr static site pre-configured with `jaspr_content`, which includes a `DocsLayout` with sidebar, header, dark/light mode, markdown parsing, and syntax highlighting out of the box.
11+
12+
## 2. Migrate your content
13+
14+
Your current docs are 10 Markdown files in `site/docs/` with YAML frontmatter (`sidebar_position`, `title`, `description`). These can largely be copied over as-is -- `jaspr_content` uses a `FilesystemLoader` that reads `.md` files from a content directory and supports frontmatter.
15+
16+
The current sidebar is auto-generated from the filesystem in Docusaurus. In Jaspr, the sidebar is defined explicitly in Dart code:
17+
18+
```dart
19+
sidebar: Sidebar(groups: [
20+
SidebarGroup(links: [
21+
SidebarLink(text: 'Overview', href: '/'),
22+
]),
23+
SidebarGroup(title: 'Workflows', links: [
24+
SidebarLink(text: 'Dart Package', href: '/workflows/dart_package'),
25+
SidebarLink(text: 'Flutter Package', href: '/workflows/flutter_package'),
26+
// ... etc
27+
]),
28+
]),
29+
```
30+
31+
## 3. Recreate the custom homepage
32+
33+
The current homepage (`site/src/pages/index.tsx`) is a custom React component with a hero banner, CTA button, and blog section. In Jaspr, you'd build this as a `StatelessComponent` using Jaspr's HTML element functions (`div`, `a`, `img`, etc.) with typed `Styles` for CSS.
34+
35+
## 4. Migrate theming
36+
37+
The custom CSS (`site/src/css/custom.css`) defines brand colors, Poppins font, and dark mode overrides. In Jaspr, theming is done via `ContentTheme`:
38+
39+
```dart
40+
theme: ContentTheme(
41+
primary: ThemeColor(Color('#2a48df'), dark: Color('#66fbd1')),
42+
background: ThemeColor(Colors.white, dark: Color('#0b0d0e')),
43+
),
44+
```
45+
46+
## 5. Update the deployment workflow
47+
48+
Replace the Node/Docusaurus build steps in `.github/workflows/site_deploy.yaml` with Dart/Jaspr:
49+
50+
```yaml
51+
- uses: dart-lang/setup-dart@v1
52+
- run: dart pub global activate jaspr_cli
53+
- run: jaspr build
54+
# Output goes to build/jaspr/ instead of site/build/
55+
```
56+
57+
## Key differences to be aware of
58+
59+
| Aspect | Docusaurus (current) | Jaspr |
60+
|---|---|---|
61+
| Sidebar | Auto-generated from filesystem | Manual definition in Dart |
62+
| Custom pages | React/TSX components | Dart `StatelessComponent` |
63+
| Styling | CSS/CSS Modules | Typed `Styles` in Dart + optional CSS |
64+
| Markdown extensions | MDX (JSX in Markdown) | Custom components registered in Dart |
65+
| Search | Algolia integration available | No built-in search |
66+
| Docs versioning | Built-in | Not available |
67+
68+
## Tradeoffs
69+
70+
The main benefit is staying entirely within the Dart ecosystem. The main costs are losing Docusaurus's auto-generated sidebar, built-in search integration, and the broader plugin ecosystem. The site is relatively straightforward (10 doc pages, one custom homepage), so the migration scope is manageable.

site_jaspr/content/docs/workflows.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,38 +10,38 @@ Learn about all of the workflows that Very Good Workflows supports.
1010
<div class="workflow-cards">
1111
<a class="workflow-card" href="/docs/workflows/dart_package">
1212
<h3>📄 Dart Package</h3>
13-
<p>This workflow runs helpful checks on ...</p>
13+
<p>This workflow runs helpful checks on a Dart package according to the steps below. As with any workflow, it can be customized.</p>
1414
</a>
1515
<a class="workflow-card" href="/docs/workflows/dart_pub_publish">
1616
<h3>📄 Dart Pub Publish</h3>
17-
<p>We use this workflow to publish a Da...</p>
17+
<p>We use this workflow to publish a Dart package to pub.dev.</p>
1818
</a>
1919
<a class="workflow-card" href="/docs/workflows/flutter_package">
2020
<h3>📄 Flutter Package</h3>
21-
<p>This workflow runs helpful checks on ...</p>
21+
<p>This workflow runs helpful checks on a Flutter package according to the steps below. As with any workflow, it can be customized.</p>
2222
</a>
2323
<a class="workflow-card" href="/docs/workflows/flutter_pub_publish">
2424
<h3>📄 Flutter Pub Publish</h3>
25-
<p>We use this workflow to publish a Flu...</p>
25+
<p>We use this workflow to publish a Flutter package to pub.dev.</p>
2626
</a>
2727
<a class="workflow-card" href="/docs/workflows/license_check">
2828
<h3>📄 License Check</h3>
29-
<p>At VGV, we keep track of the rights a...</p>
29+
<p>At VGV, we keep track of the rights and restrictions external dependencies might impose on Dart or Flutter projects.</p>
3030
</a>
3131
<a class="workflow-card" href="/docs/workflows/mason_publish">
3232
<h3>📄 Mason Publish</h3>
33-
<p>We use this workflow to publish a bri...</p>
33+
<p>We use this workflow to publish a brick to brickhub.dev.</p>
3434
</a>
3535
<a class="workflow-card" href="/docs/workflows/pana">
3636
<h3>📄 Pana</h3>
37-
<p>We use the Dart tool pana to validat...</p>
37+
<p>We use the Dart tool pana to validate that your pub score will be the max possible score before publishing a package to pub.dev.</p>
3838
</a>
3939
<a class="workflow-card" href="/docs/workflows/semantic_pull_request">
4040
<h3>📄 Semantic Pull Request</h3>
41-
<p>At VGV, we use conventional commit...</p>
41+
<p>At VGV, we use conventional commits. This way, our commit history is clean and useful when we squash and merge — we can easily see the type and brief description of each PR.</p>
4242
</a>
4343
<a class="workflow-card" href="/docs/workflows/spell_check">
4444
<h3>📄 Spell Check</h3>
45-
<p>We use cspell for basic spell check o...</p>
45+
<p>We use cspell for basic spell check on our projects.</p>
4646
</a>
4747
</div>

site_jaspr/lib/styles/site_styles.dart

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,11 @@ List<StyleRule> get siteStyles => [
282282
// 9. CONTENT AREA LINKS
283283
// Primary color, no underline; underline on hover (matching original).
284284
// ───────────────────────────────────────────────────────────────────────
285-
css('.content-container a:not(.breadcrumb-link)').styles(
285+
css('.content-container a:not(.breadcrumb-link):not(.workflow-card)').styles(
286286
color: Color('var(--content-links)'),
287287
textDecoration: TextDecoration.none,
288288
),
289-
css('.content-container a:not(.breadcrumb-link):hover').styles(
289+
css('.content-container a:not(.breadcrumb-link):not(.workflow-card):hover').styles(
290290
textDecoration: TextDecoration(line: TextDecorationLine.underline),
291291
),
292292
// Callout links: inherit foreground color + always underlined (Infima alert behavior).
@@ -536,18 +536,28 @@ List<StyleRule> get siteStyles => [
536536
},
537537
),
538538
css('&:hover').styles(
539-
raw: {'border-color': '#2a48df', 'text-decoration': 'none'},
539+
textDecoration: TextDecoration.none,
540+
raw: {'border-color': '#2a48df'},
540541
),
541542
css('h3').styles(
542543
margin: Margin.only(bottom: 0.25.rem),
543544
fontSize: 1.25.rem,
544545
fontWeight: FontWeight.w700,
546+
textDecoration: TextDecoration.none,
545547
raw: {'margin-top': '0'},
546548
),
547549
css('p').styles(
548550
margin: Margin.zero,
549551
opacity: 0.6,
552+
overflow: Overflow.hidden,
553+
color: Color('#000000'),
550554
fontSize: 0.875.rem,
555+
textDecoration: TextDecoration.none,
556+
raw: {
557+
'display': '-webkit-box',
558+
'-webkit-line-clamp': '2',
559+
'-webkit-box-orient': 'vertical',
560+
},
551561
),
552562
]),
553563
// Dark mode workflow cards
@@ -557,6 +567,9 @@ List<StyleRule> get siteStyles => [
557567
'border-color': '#444950',
558568
},
559569
),
570+
css('[data-theme="dark"] .workflow-card p').styles(
571+
color: Color('#ffffff'),
572+
),
560573
css('[data-theme="dark"] .workflow-card:hover').styles(
561574
raw: {'border-color': '#66fbd1'},
562575
),

0 commit comments

Comments
 (0)