hd-garden 0.8.0 → 0.8.2

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.
Files changed (187) hide show
  1. package/.agents/skills/garden-ui/SKILL.md +2 -2
  2. package/.env.en.example +67 -0
  3. package/README.en.md +2 -2
  4. package/README.md +2 -2
  5. package/app/a2/[slug]/page.tsx +4 -3
  6. package/app/a2/page.tsx +4 -3
  7. package/app/about/page.tsx +8 -9
  8. package/app/admin/page.tsx +7 -6
  9. package/app/admin/preview/[...path]/page.tsx +2 -1
  10. package/app/admin/ui/blocks/page.tsx +2 -1
  11. package/app/admin/ui/catalog/page.tsx +2 -1
  12. package/app/admin/ui/evals/page.tsx +2 -1
  13. package/app/admin/ui/page.tsx +2 -1
  14. package/app/blog/[...path]/page.tsx +7 -6
  15. package/app/blog/page.tsx +4 -2
  16. package/app/columns/[column]/[...path]/page.tsx +8 -7
  17. package/app/columns/page.tsx +12 -8
  18. package/app/components/AdminUiShell.tsx +4 -3
  19. package/app/components/ArticleMeasure.tsx +6 -3
  20. package/app/components/ArticleReferences.tsx +4 -1
  21. package/app/components/ArticleTags.tsx +3 -2
  22. package/app/components/BlogArchive.tsx +20 -16
  23. package/app/components/Comments.tsx +16 -10
  24. package/app/components/ContentEmptyState.tsx +29 -28
  25. package/app/components/ExternalEmbed.tsx +15 -14
  26. package/app/components/GardenContentGuide.tsx +10 -2
  27. package/app/components/GardenDocsNav.tsx +4 -2
  28. package/app/components/GiscusComments.tsx +2 -1
  29. package/app/components/GithubLiveOverview.tsx +10 -8
  30. package/app/components/GithubProfile.tsx +31 -21
  31. package/app/components/HandbookLangSwitch.tsx +8 -4
  32. package/app/components/HandbookView.tsx +92 -9
  33. package/app/components/MarkdownArticle.tsx +31 -7
  34. package/app/components/MermaidDiagram.tsx +4 -3
  35. package/app/components/SiteChrome.tsx +3 -3
  36. package/app/components/SiteFooter.tsx +1 -1
  37. package/app/components/SiteHeader.tsx +13 -4
  38. package/app/components/ThoughtCard.tsx +16 -14
  39. package/app/components/UiBlock.tsx +3 -2
  40. package/app/components/Webmentions.tsx +11 -11
  41. package/app/components/WidgetChart.tsx +8 -6
  42. package/app/components/garden/FilePreview.tsx +2 -2
  43. package/app/components/garden/GardenBlock.tsx +7 -0
  44. package/app/components/garden/GardenFile.tsx +2 -2
  45. package/app/components/garden/RefDemo.tsx +62 -0
  46. package/app/components/garden/blocks.tsx +56 -8
  47. package/app/components/garden/patterns.tsx +497 -0
  48. package/app/garden/[...slug]/page.tsx +3 -2
  49. package/app/garden/en/page.tsx +7 -7
  50. package/app/garden/page.tsx +3 -2
  51. package/app/globals.css +49 -1
  52. package/app/lib/a2-meta.ts +26 -3
  53. package/app/lib/content.ts +2 -2
  54. package/app/lib/garden-docs-meta.ts +24 -0
  55. package/app/lib/github-id.mjs +8 -0
  56. package/app/lib/handbook-switch.mjs +12 -0
  57. package/app/lib/i18n.ts +401 -2
  58. package/app/lib/rehype-field-tables.mjs +47 -0
  59. package/app/lib/remark-a2.mjs +18 -8
  60. package/app/lib/remark-link-card.mjs +22 -0
  61. package/app/lib/remark-ref-demos.mjs +42 -0
  62. package/app/lib/tag-filter.ts +9 -2
  63. package/app/not-found.tsx +32 -4
  64. package/app/page.tsx +17 -14
  65. package/app/rss.xml/route.ts +2 -1
  66. package/app/styles/a2.css +338 -0
  67. package/app/styles/shell.css +15 -2
  68. package/app/tags/page.tsx +7 -5
  69. package/app/thoughts/[slug]/page.tsx +2 -1
  70. package/app/thoughts/page/[n]/page.tsx +1 -1
  71. package/app/thoughts/page.tsx +2 -1
  72. package/app/ui-parity/page.tsx +38 -22
  73. package/bin/garden.mjs +129 -19
  74. package/docs/handbook/ai-writing.md +2 -2
  75. package/docs/handbook/assets/reading-layout-en.svg +26 -0
  76. package/docs/handbook/components/card.md +43 -22
  77. package/docs/handbook/components/chart.md +10 -26
  78. package/docs/handbook/components/choice.md +42 -0
  79. package/docs/handbook/components/compare.md +32 -17
  80. package/docs/handbook/components/figure.md +33 -46
  81. package/docs/handbook/components/file.md +10 -15
  82. package/docs/handbook/components/html.md +10 -30
  83. package/docs/handbook/components/interactive.md +9 -35
  84. package/docs/handbook/components/list.md +65 -0
  85. package/docs/handbook/components/relations.md +95 -0
  86. package/docs/handbook/components/stat.md +10 -28
  87. package/docs/handbook/components/timeline.md +13 -28
  88. package/docs/handbook/components.md +210 -19
  89. package/docs/handbook/config.md +5 -3
  90. package/docs/handbook/deploy.md +1 -1
  91. package/docs/handbook/design.md +20 -12
  92. package/docs/handbook/en/ai-writing.md +2 -2
  93. package/docs/handbook/en/components/card.md +42 -21
  94. package/docs/handbook/en/components/chart.md +10 -26
  95. package/docs/handbook/en/components/choice.md +42 -0
  96. package/docs/handbook/en/components/compare.md +30 -15
  97. package/docs/handbook/en/components/figure.md +29 -42
  98. package/docs/handbook/en/components/file.md +9 -14
  99. package/docs/handbook/en/components/html.md +9 -29
  100. package/docs/handbook/en/components/interactive.md +8 -34
  101. package/docs/handbook/en/components/list.md +65 -0
  102. package/docs/handbook/en/components/relations.md +95 -0
  103. package/docs/handbook/en/components/stat.md +9 -27
  104. package/docs/handbook/en/components/timeline.md +9 -24
  105. package/docs/handbook/en/components.md +211 -19
  106. package/docs/handbook/en/config.md +32 -30
  107. package/docs/handbook/en/deploy.md +12 -12
  108. package/docs/handbook/en/design.md +19 -12
  109. package/docs/handbook/en/index.md +2 -2
  110. package/docs/handbook/en/reference/card.md +85 -0
  111. package/docs/handbook/en/reference/chart.md +68 -0
  112. package/docs/handbook/en/reference/choice.md +69 -0
  113. package/docs/handbook/en/reference/compare.md +59 -0
  114. package/docs/handbook/en/reference/figure.md +84 -0
  115. package/docs/handbook/en/reference/file/checklist.md +17 -0
  116. package/docs/handbook/en/reference/file.md +50 -0
  117. package/docs/handbook/en/reference/html.md +62 -0
  118. package/docs/handbook/en/reference/interactive.md +71 -0
  119. package/docs/handbook/en/reference/list.md +72 -0
  120. package/docs/handbook/en/reference/relations.md +113 -0
  121. package/docs/handbook/en/reference/stat.md +60 -0
  122. package/docs/handbook/en/reference/timeline.md +56 -0
  123. package/docs/handbook/en/reference.md +26 -0
  124. package/docs/handbook/en/start.md +2 -2
  125. package/docs/handbook/en/workflow.md +6 -5
  126. package/docs/handbook/en/writing.md +3 -2
  127. package/docs/handbook/index.md +1 -1
  128. package/docs/handbook/reference/card.md +85 -0
  129. package/docs/handbook/reference/chart.md +68 -0
  130. package/docs/handbook/reference/choice.md +69 -0
  131. package/docs/handbook/reference/compare.md +59 -0
  132. package/docs/handbook/reference/figure.md +84 -0
  133. package/docs/handbook/reference/file/checklist.md +17 -0
  134. package/docs/handbook/reference/file.md +50 -0
  135. package/docs/handbook/reference/html.md +62 -0
  136. package/docs/handbook/reference/interactive.md +71 -0
  137. package/docs/handbook/reference/list.md +72 -0
  138. package/docs/handbook/reference/relations.md +113 -0
  139. package/docs/handbook/reference/stat.md +60 -0
  140. package/docs/handbook/reference/timeline.md +56 -0
  141. package/docs/handbook/reference.md +26 -0
  142. package/docs/handbook/start.md +1 -1
  143. package/docs/handbook/workflow.md +6 -5
  144. package/docs/handbook/writing.md +3 -2
  145. package/next.config.ts +6 -0
  146. package/package.json +2 -1
  147. package/public/images/garden/ref-card-book.svg +1 -0
  148. package/public/images/garden/ref-card-lamp.svg +1 -0
  149. package/scripts/build-content.mjs +37 -16
  150. package/scripts/favicon-ico.mjs +9 -6
  151. package/scripts/file-preview.mjs +10 -7
  152. package/scripts/handbook-allowlist.mjs +18 -0
  153. package/scripts/handbook-facts.mjs +305 -11
  154. package/scripts/link-assets.mjs +7 -0
  155. package/scripts/new-post.mjs +18 -9
  156. package/scripts/prepare-pages-output.mjs +30 -18
  157. package/scripts/redirects.mjs +17 -6
  158. package/templates/garden-blocks.md +67 -0
  159. package/templates/garden-snippets.plist +61 -0
  160. package/templates/site/Makefile.en +45 -0
  161. package/templates/site/README.en.md +15 -0
  162. package/templates/site/site.config.en.yaml +55 -0
  163. package/templates/skills-en/garden-interactive-chart/SKILL.md +84 -0
  164. package/templates/skills-en/garden-interactive-chart/references/shell.html +49 -0
  165. package/templates/skills-en/garden-interactive-chart/references/style.md +61 -0
  166. package/templates/skills-en/garden-post-review/SKILL.md +63 -0
  167. package/templates/skills-en/garden-ui/SKILL.md +118 -0
  168. package/templates/workflows/pages.en.yml +195 -0
  169. package/templates/workflows/pages.yml +195 -0
  170. package/ui/garden/catalog.mjs +205 -4
  171. package/ui/garden/check.mjs +6 -0
  172. package/ui/garden/file-block.mjs +8 -7
  173. package/ui/garden/html-lang.mjs +73 -1
  174. package/ui/garden/markdown-links.mjs +7 -4
  175. package/ui/garden/parse.mjs +45 -0
  176. package/ui/garden/relations.mjs +252 -0
  177. package/ui/garden/search-index.mjs +6 -4
  178. package/ui/garden/source-icon.mjs +54 -0
  179. package/ui/parity-fixtures.mjs +77 -0
  180. package/ui/preview/dist/garden-ui.esm.js +41 -4
  181. package/ui/preview/dist/garden-ui.iife.js +41 -4
  182. package/ui/prompt/rules.md +28 -1
  183. package/ui/react/components/chart.tsx +1 -1
  184. package/ui/react/components/display.tsx +1 -1
  185. package/ui/react/lang.tsx +4 -0
  186. package/ui/react/parity.tsx +8 -6
  187. package/worker/index.ts +8 -2
@@ -1,30 +1,222 @@
1
1
  ---
2
2
  title: Components Overview
3
3
  navTitle: Overview
4
- description: What each of the 9 built-in garden components is for, its fence name, and its required fields.
4
+ description: Live preview of all 12 built-in components.
5
5
  section: components
6
6
  order: 30
7
7
  ---
8
8
 
9
- You can describe any of these 9 components in a single sentence inside a `garden` idea block and let your Agent generate the block with the `garden-ui` skill (see [Writing with AI](/garden/en/ai-writing)). When writing by hand, open a ```` ```garden <name> ```` code block with the English component name (`card`, `stat`, `compare`, `timeline`, `chart`, `figure`, `html`, `interactive`, or `file`); parameters use YAML, while `interactive` takes declarative tags below `---`.
9
+ ## [Reference Card · card](/garden/en/components/card)
10
10
 
11
- ## Component Quick Reference
11
+ ```garden card
12
+ title: SQLite Write-Ahead Logging
13
+ url: https://www.sqlite.org/wal.html
14
+ meta: Documentation · sqlite.org
15
+ description: Appends changes sequentially to a write-ahead log while readers continue reading the original database pages, reducing read-write contention.
16
+ points:
17
+ - Writes append to the end of the `-wal` file instead of overwriting database pages in place on commit.
18
+ - Readers record the current end-of-log mark to see a consistent snapshot without blocking concurrent writers.
19
+ ```
12
20
 
13
- | Component | Code Fence | When to Use | Minimum Requirement |
14
- | :--- | :--- | :--- | :--- |
15
- | [card](/garden/en/components/card) | ```` ```garden card ```` | Summarize a paper, open-source project, or subsystem | Provide `description` or `points` |
16
- | [stat](/garden/en/components/stat) | ```` ```garden stat ```` | Place 2 to 4 key numbers and units side by side | Each item requires `label` and `value` |
17
- | [compare](/garden/en/components/compare) | ```` ```garden compare ```` | Compare 2 or 3 options or before/after tradeoffs side by side | At least 2 `items`, ~60 characters per cell |
18
- | [timeline](/garden/en/components/timeline) | ```` ```garden timeline ```` | Walk through debugging steps or release stages in order | At least 2 `items` |
19
- | [chart](/garden/en/components/chart) | ```` ```garden chart ```` | Plot proportional bars from YAML rows (includes an expandable table) | At least 2 rows in `data` |
20
- | [figure](/garden/en/components/figure) | ```` ```garden figure ```` | Highlight regions of an SVG or image diagram with step buttons | Either `svg` or `image` |
21
- | [html](/garden/en/components/html) | ```` ```garden html ```` | Run a self-contained HTML/JS demo in a sandboxed `iframe` | Either `src` or `code` |
22
- | [interactive](/garden/en/components/interactive) | ```` ```garden interactive ```` | Let readers drag sliders or switches to evaluate a non-trivial formula | Must include an input control and a formula beyond a single multiplication |
23
- | [file](/garden/en/components/file) | ```` ```garden file ```` | Offer local or remote attachments for download and inline preview | Either `src` or `files` |
21
+ ## [Key Figures · stat](/garden/en/components/stat)
24
22
 
25
- ## Authoring Rules
23
+ ```garden stat
24
+ items:
25
+ - label: Reading Column
26
+ value: "740"
27
+ unit: px
28
+ caption: Default prose column width
29
+ - label: Wide Figure Limit
30
+ value: "1040"
31
+ unit: px
32
+ caption: Extends up to 150px on each side
33
+ - label: Wide Table Limit
34
+ value: "1340"
35
+ unit: px
36
+ caption: Extends up to 300px on each side
37
+ ```
26
38
 
27
- 1. **Use standard Markdown first**: Write regular paragraphs, ordered lists, and comparison tables in plain Markdown, and reach for a `garden` fence only when a structured block makes the point easier to read.
28
- 2. **Do not duplicate the same numbers**: A `chart` block already includes an expandable data table underneath, so do not put a second Markdown table with the same figures in the same section.
29
- 3. **Inline formatting works inside fields**: Text fields such as `text`, `description`, `caption`, and `points` accept inline `**bold**`, `` `code` ``, and `<u>highlighter underline</u>`.
30
- 4. **Preview every component locally**: Run `npx garden ui catalog` to generate `.garden/ui-catalog.html` and open it in your browser.
39
+ ## [Side-by-Side Comparison · compare](/garden/en/components/compare)
40
+
41
+ ```garden compare
42
+ items:
43
+ - title: Describe the change in one sentence
44
+ text: Idea block under full code; the AI writes the diff.
45
+ - title: Write the diff by hand
46
+ text: Place a diff block right below the full code block.
47
+ ```
48
+
49
+ ## [Step Timeline · timeline](/garden/en/components/timeline)
50
+
51
+ ```garden timeline
52
+ items:
53
+ - date: Step 1
54
+ title: Sync Content and Assets
55
+ text: Validate Front Matter, copy attachments, and build the search index and RSS feed.
56
+ - date: Step 2
57
+ title: Build Static Site Output
58
+ text: Prerender every route into the static output directory.
59
+ ```
60
+
61
+ ## [Bar Chart · chart](/garden/en/components/chart)
62
+
63
+ ```garden chart
64
+ title: Max Width by Layout Zone
65
+ xLabel: Layout Zone
66
+ yLabel: Max Width
67
+ unit: px
68
+ data:
69
+ - x: Prose Column
70
+ y: 740
71
+ - x: Wide Figure Zone
72
+ y: 1040
73
+ - x: Wide Table Zone
74
+ y: 1340
75
+ ```
76
+
77
+ ## [Annotated Diagram · figure](/garden/en/components/figure)
78
+
79
+ ```garden figure
80
+ svg: |
81
+ <svg viewBox="0 0 560 194" xmlns="http://www.w3.org/2000/svg" font-family="var(--sans)" style="max-width: 380px; margin-inline: auto">
82
+ <rect data-p="sync" x="2" y="4" width="180" height="186" rx="16" fill="var(--card)" stroke="var(--rule-strong)" stroke-width="2.5"/>
83
+ <text data-p="sync" x="92" y="42" text-anchor="middle" font-size="24" font-weight="600" fill="var(--ink)">1. garden</text>
84
+ <text data-p="sync" x="92" y="72" text-anchor="middle" font-size="24" font-weight="600" fill="var(--ink)">sync</text>
85
+ <text data-p="sync" x="92" y="108" text-anchor="middle" font-size="24" fill="var(--muted)">Parse</text>
86
+ <text data-p="sync" x="92" y="137" text-anchor="middle" font-size="24" fill="var(--muted)">Markdown &amp;</text>
87
+ <text data-p="sync" x="92" y="166" text-anchor="middle" font-size="24" fill="var(--muted)">image sizes</text>
88
+ <path d="M183.5 97 H188.5" stroke="var(--muted)" stroke-width="2.5"/>
89
+ <rect data-p="build" x="190" y="4" width="180" height="186" rx="16" fill="var(--card)" stroke="var(--rule-strong)" stroke-width="2.5"/>
90
+ <text data-p="build" x="280" y="42" text-anchor="middle" font-size="24" font-weight="600" fill="var(--ink)">2. garden</text>
91
+ <text data-p="build" x="280" y="72" text-anchor="middle" font-size="24" font-weight="600" fill="var(--ink)">build</text>
92
+ <text data-p="build" x="280" y="108" text-anchor="middle" font-size="24" fill="var(--muted)">Build static</text>
93
+ <text data-p="build" x="280" y="137" text-anchor="middle" font-size="24" fill="var(--muted)">pages &amp; index</text>
94
+ <path d="M371.5 97 H376.5" stroke="var(--muted)" stroke-width="2.5"/>
95
+ <rect data-p="validate" x="378" y="4" width="180" height="186" rx="16" fill="var(--card)" stroke="var(--rule-strong)" stroke-width="2.5"/>
96
+ <text data-p="validate" x="468" y="42" text-anchor="middle" font-size="24" font-weight="600" fill="var(--ink)">3. pages:</text>
97
+ <text data-p="validate" x="468" y="72" text-anchor="middle" font-size="24" font-weight="600" fill="var(--ink)">validate</text>
98
+ <text data-p="validate" x="468" y="108" text-anchor="middle" font-size="24" fill="var(--muted)">Check</text>
99
+ <text data-p="validate" x="468" y="137" text-anchor="middle" font-size="24" fill="var(--muted)">exported files</text>
100
+ </svg>
101
+ parts:
102
+ - id: sync
103
+ label: 1. Sync Content
104
+ text: Scans posts and sidecar assets to generate site data.
105
+ - id: build
106
+ label: 2. Build Pages
107
+ text: Prerenders all routes and outputs RSS, sitemap, and search indexes.
108
+ - id: validate
109
+ label: 3. Validate Export
110
+ text: Checks that the exported static directory is complete.
111
+ ```
112
+
113
+ ## [Embedded Web Snippet · html](/garden/en/components/html)
114
+
115
+ ```garden html
116
+ title: Character Count Widget
117
+ code: |
118
+ <!doctype html>
119
+ <html lang="en">
120
+ <head>
121
+ <meta charset="utf-8" />
122
+ <style>
123
+ body { margin: 0; padding: 16px 18px; font: 14px/1.6 system-ui, sans-serif; color: #1b1a18; background: #faf9f5; }
124
+ input { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid #d5d1c8; border-radius: 6px; font: inherit; background: #fff; color: #1b1a18; }
125
+ .meta { margin-top: 10px; color: #6e6b64; font-variant-numeric: tabular-nums; }
126
+ strong { color: #1b1a18; }
127
+ </style>
128
+ </head>
129
+ <body>
130
+ <input id="txt" value="Keep your posts in a Git repository and push to deploy." aria-label="Sample text input" />
131
+ <div class="meta">Characters: <strong id="count">55</strong></div>
132
+ <script>
133
+ const input = document.getElementById("txt");
134
+ const count = document.getElementById("count");
135
+ input.addEventListener("input", () => { count.textContent = String(input.value.length); });
136
+ </script>
137
+ </body>
138
+ </html>
139
+ ```
140
+
141
+ ## [Interactive Formula & Parameters · interactive](/garden/en/components/interactive)
142
+
143
+ ```garden interactive #overview-reading
144
+ caption: "Example: estimate reading time from word count and reading speed."
145
+ ---
146
+ <State words={6000} speed={400} />
147
+ <Let minutes={round(words / speed)} />
148
+
149
+ <Slider bind="words" label="Word count" min={1000} max={20000} step={500} unit="words" />
150
+ <Slider bind="speed" label="Reading speed" min={200} max={800} step={50} unit="wpm" />
151
+
152
+ <Stat label="Estimated reading time" value={minutes} unit="min" />
153
+ ```
154
+
155
+ ## [File Download & Preview · file](/garden/en/components/file)
156
+
157
+ ```garden file
158
+ src: ./components/file/checklist.md
159
+ title: Pre-publish Checklist
160
+ note: Click Preview to read inline or Download to save the file
161
+ ```
162
+
163
+ ## [Relationship diagram · relations](/garden/en/components/relations)
164
+
165
+ ```garden relations
166
+ items:
167
+ - title: Pick
168
+ text: Choose this month's book
169
+ - title: Read
170
+ text: Finish the agreed chapters each week
171
+ - title: Talk
172
+ text: Meet and share views
173
+ - title: Review
174
+ text: Note what to change next time
175
+ links:
176
+ - from: 1
177
+ to: 2
178
+ - from: 2
179
+ to: 3
180
+ - from: 3
181
+ to: 4
182
+ - from: 4
183
+ to: 1
184
+ - from: 3
185
+ to: 1
186
+ style: dashed
187
+ label: shapes the pick
188
+ ```
189
+
190
+ ## [Icon List · list](/garden/en/components/list)
191
+
192
+ ```garden list
193
+ items:
194
+ - icon: search
195
+ text: Searches for this month's title
196
+ - icon: eye
197
+ text: Reads 3 reviews
198
+ - icon: heart
199
+ text: Saves the event page
200
+ - icon: chat
201
+ text: Asks in the group chat whether listening only is fine
202
+ ```
203
+
204
+ ## [Choice Cards · choice](/garden/en/components/choice)
205
+
206
+ ```garden choice
207
+ title: Where should we meet next month?
208
+ items:
209
+ - icon: idea
210
+ value: $6 each
211
+ text: Corner café, one drink included
212
+ label: Prefer the atmosphere
213
+ reply: Café it is. We will book the long table by the window.
214
+ - icon: book
215
+ value: Free
216
+ text: Library meeting room, booking needed
217
+ label: Prefer the quiet
218
+ reply: Library it is. We will book the room at the start of the month.
219
+ none:
220
+ label: Neither / not sure
221
+ reply: No problem. We will share a few more venues in the group chat.
222
+ ```
@@ -10,16 +10,16 @@ Global site copy and appearance settings live in `site.config.yaml` at the repos
10
10
 
11
11
  ## 1. Full `site.config.yaml` Structure
12
12
 
13
- Here is the default `site.config.yaml` shipped with the site template:
13
+ Below are the default `site.config.yaml` fields generated for an English site (`npx hd-garden init --locale en_US`):
14
14
 
15
15
  ```yaml
16
16
  name: Garden
17
- tagline: 写作 · 记录 · 保持好奇
18
- description: 文章、随想和专栏。
19
- locale: zh_CN
20
- # 站点的公开地址。文章里指向这个地址的完整网址会按站内链接显示。
17
+ tagline: Writing · Notes · Staying curious
18
+ description: Posts, short notes, and columns.
19
+ locale: en_US
20
+ # Public address of the site. Full URLs pointing here inside posts render as internal links.
21
21
  # url: https://blog.example.com
22
- # 站点图标,不写时使用 Garden 自带的图标。
22
+ # Site icons; falls back to Garden's built-in icons when omitted.
23
23
  # brand:
24
24
  # logo: brand/logo.svg
25
25
  # favicon: /favicon.svg
@@ -28,44 +28,46 @@ locale: zh_CN
28
28
  author:
29
29
  name: Your Name
30
30
  github: your-github-id
31
- githubBio: 一句自我介绍。
31
+ githubBio: A short bio.
32
32
  githubPinned: []
33
33
 
34
34
  pages:
35
35
  home:
36
36
  title: |-
37
- 记一些正在做的事,
38
- 和想清楚的问题。
39
- subtitle: 软件、笔记,和偶尔的工作记录。
37
+ Notes on what I am building,
38
+ and questions worth thinking through.
39
+ subtitle: Software, reading notes, and occasional work logs.
40
40
  blog:
41
- title: 博文
42
- subtitle: 写完的长文。
41
+ title: Posts
42
+ subtitle: Finished long-form essays.
43
43
  thoughts:
44
- title: 随想
45
- subtitle: 短笔记、图片和链接。
44
+ title: Thoughts
45
+ subtitle: Short notes, images, and links.
46
+ # How many items to show per screen; the next screen loads automatically as you scroll. Default: 10.
47
+ # pageSize: 10
46
48
  columns:
47
- title: 专栏
48
- subtitle: 按顺序读的一组文章。
49
+ title: Columns
50
+ subtitle: Series of posts meant to be read in order.
49
51
  about:
50
- title: 你好,我是 Your Name。
51
- subtitle: 文章和笔记都在这里。
52
- heading: 关于
52
+ title: Hi, I am Your Name.
53
+ subtitle: Essays and notes live here.
54
+ heading: About
53
55
  paragraphs:
54
- - 一名工程师。平时写代码,也把想清楚的问题记下来。
55
- - 这里放文章、随想和专栏。
56
+ - A software engineer writing code and keeping notes on things figured out along the way.
57
+ - This site holds long-form posts, short thoughts, and columns.
56
58
  quote: ""
57
59
  focus:
58
- - 软件
59
- - 笔记
60
- - 日常
60
+ - Software
61
+ - Notes
62
+ - Daily
61
63
  cta:
62
64
  href: /blog
63
- label: 浏览博文
65
+ label: Browse posts
64
66
  garden:
65
- title: "用 Markdown 写。\n推送之后,网站自己更新。"
67
+ title: "Write in Markdown.\nPush to update the site."
66
68
  subtitle: ""
67
69
 
68
- footer: 持续记录。
70
+ footer: Keep writing.
69
71
  ```
70
72
 
71
73
  ### Top-level and Author Fields
@@ -75,7 +77,7 @@ footer: 持续记录。
75
77
  | `name` | Site name shown in the top-left header, browser title suffix, and RSS feed title |
76
78
  | `tagline` | Site tagline |
77
79
  | `description` | Site summary used for the home page SEO description and RSS channel description |
78
- | `locale` | Language and region tag (`zh_CN` by default; setting `en_US` switches the site chrome to English at build time) |
80
+ | `locale` | Language and region tag (`zh_CN` by default; setting `en_US` switches all framework-rendered UI strings—navigation, home page, post list, post metadata and permalink label, Giscus prompts, tags, columns, About page, 404 page, pagination, RSS/sitemap, and meta/og—to English at build time) |
79
81
  | `url` | Public root URL of the site (such as `https://blog.example.com`). Full URLs pointing to this address inside posts are treated as internal links |
80
82
  | `author.name` | Author name displayed in article metadata, the About page, and the footer |
81
83
  | `author.github` | GitHub username (without the full URL), used to link your GitHub profile and fetch public activity for the About page |
@@ -107,7 +109,7 @@ Columns group multiple posts from `content/posts/` into an ordered reading serie
107
109
  columns:
108
110
  - slug: building-in-public
109
111
  title: Building in Public
110
- status: Ongoing
112
+ status: ongoing
111
113
  description: Notes from initial prototype to production release.
112
114
  cover: windowsill-herbs.svg
113
115
  posts:
@@ -120,6 +122,6 @@ columns:
120
122
  | `slug` | Yes | Column identifier (lowercase letters, digits, and hyphens only), generating routes at `/columns/<slug>/<post>` |
121
123
  | `title` | Yes | Column title (also shown beside member posts on `/blog`) |
122
124
  | `description` | Yes | Column summary shown on `/columns` cards |
123
- | `status` | No | Status badge text |
125
+ | `status` | No | Status value: `default` (or omitted, shown as "Active"), `ongoing` ("Ongoing"), or `completed` ("Completed"). Legacy Chinese values are still accepted, and any other text is shown verbatim |
124
126
  | `cover` | No | Cover image path relative to `content/covers/` |
125
127
  | `posts` | Yes | Ordered array of post paths relative to `content/posts/`, without the `.md` extension |
@@ -6,7 +6,7 @@ section: getting-started
6
6
  order: 4
7
7
  ---
8
8
 
9
- `npx hd-garden init` does not create `.github/workflows/pages.yml` automatically. Add this file to your site repository when you are ready to publish to GitHub Pages. The same workflow supports both a **single public repository** and a **private source repository + public Pages repository**, switching automatically based on whether the `PAGES_REPOSITORY` variable is set.
9
+ Initializing an English site (`npx hd-garden init --locale en` or `--locale en_US`) installs `templates/workflows/pages.en.yml` to `.github/workflows/pages.yml` automatically (default `zh_CN` initialization does not create it automatically). Review or add this file in your site repository when you are ready to publish to GitHub Pages. The same workflow supports both a **single public repository** and a **private source repository + public Pages repository**, switching automatically based on whether the `PAGES_REPOSITORY` variable is set.
10
10
 
11
11
  The workflow below matches Garden's own `.github/workflows/pages.yml` with two adjustments for a site repo: it omits `paths-ignore`, `npm run lint`, and `npm test` (which only apply to the engine repo), and its `publish-repository` job installs dependencies before running `npx garden pages:prepare static-site pages-repository` (the same `scripts/prepare-pages-output.mjs` script Garden calls directly). Commit `package-lock.json` after your first `npm install` so `npm ci` can run in CI.
12
12
 
@@ -71,14 +71,14 @@ jobs:
71
71
  GISCUS_REPO_ID=
72
72
  GISCUS_CATEGORY=
73
73
  GISCUS_CATEGORY_ID=
74
- echo "GISCUS_DISABLED=1,本次构建不开放评论。"
74
+ echo "GISCUS_DISABLED=1; building without comments."
75
75
  else
76
- echo "评论还没有配置,构建已停止。"
77
- echo "1. 准备一个公开 GitHub 仓库,并开启 Discussions。"
78
- echo "2. 打开 https://giscus.app/zh-CN ,安装 Giscus App,选中该仓库和分类。"
79
- echo "3. 在 Settings → Secrets and variables → Actions → Variables 写入:"
80
- echo " GISCUS_REPO、GISCUS_REPO_ID、GISCUS_CATEGORY、GISCUS_CATEGORY_ID"
81
- echo "确定不开放评论时,把 GISCUS_DISABLED 设为 1。留空和示例值 owner/repository 都不会通过。"
76
+ echo "Comments are not configured yet; stopping the build."
77
+ echo "1. Prepare a public GitHub repository and enable Discussions."
78
+ echo "2. Open https://giscus.app, install the Giscus App, and pick the repository and category."
79
+ echo "3. Under Settings -> Secrets and variables -> Actions -> Variables, set:"
80
+ echo " GISCUS_REPO, GISCUS_REPO_ID, GISCUS_CATEGORY, GISCUS_CATEGORY_ID"
81
+ echo "To build without comments, set GISCUS_DISABLED to 1. Empty values and the placeholder owner/repository will not pass."
82
82
  exit 1
83
83
  fi
84
84
  fi
@@ -162,9 +162,9 @@ jobs:
162
162
  PAGES_DEPLOY_KEY: ${{ secrets.PAGES_DEPLOY_KEY }}
163
163
  TARGET_REPOSITORY: ${{ vars.PAGES_REPOSITORY }}
164
164
  run: |
165
- test -n "$PAGES_DEPLOY_KEY" || { echo "缺少 PAGES_DEPLOY_KEY Secret"; exit 1; }
165
+ test -n "$PAGES_DEPLOY_KEY" || { echo "Missing PAGES_DEPLOY_KEY secret"; exit 1; }
166
166
  [[ "$TARGET_REPOSITORY" =~ ^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$ ]] || {
167
- echo "PAGES_REPOSITORY 格式无效"
167
+ echo "Invalid PAGES_REPOSITORY format"
168
168
  exit 1
169
169
  }
170
170
 
@@ -189,7 +189,7 @@ jobs:
189
189
  expected_remote="git@github.com:$TARGET_REPOSITORY.git"
190
190
  actual_remote="$(git remote get-url origin)"
191
191
  test "$actual_remote" = "$expected_remote" || {
192
- echo "拒绝发布到非目标仓库:$actual_remote"
192
+ echo "Refusing to publish to unexpected repository: $actual_remote"
193
193
  exit 1
194
194
  }
195
195
  echo "PAGES_PREVIOUS_TREE=$(git rev-parse 'HEAD^{tree}')" >> "$GITHUB_ENV"
@@ -207,7 +207,7 @@ jobs:
207
207
  git add -A
208
208
  new_tree="$(git write-tree)"
209
209
  if [ "$new_tree" = "$PAGES_PREVIOUS_TREE" ]; then
210
- echo "静态产物没有变化,无需发布"
210
+ echo "Static output is unchanged; skipping publish"
211
211
  exit 0
212
212
  fi
213
213
  git commit -m "Deploy ${GITHUB_SHA}"
@@ -36,18 +36,25 @@ When `npx garden sync` runs, the build script reads the pixel width and height o
36
36
  ```garden figure
37
37
  caption: Click the buttons above to inspect the three stages from build to browser render
38
38
  svg: |
39
- <svg viewBox="0 0 680 110" xmlns="http://www.w3.org/2000/svg" font-family="var(--sans)">
40
- <rect data-p="sync" x="12" y="18" width="196" height="74" rx="10" fill="var(--card)" stroke="var(--rule-strong)" stroke-width="1.5"/>
41
- <text data-p="sync" x="110" y="50" text-anchor="middle" font-size="14" font-weight="600" fill="var(--ink)">1. Build-time Sizing</text>
42
- <text data-p="sync" x="110" y="72" text-anchor="middle" font-size="12" fill="var(--muted)">Emit width / height &amp; --wl</text>
43
- <path d="M214 55 H236" stroke="var(--muted)" stroke-width="1.5"/>
44
- <rect data-p="measure" x="242" y="18" width="196" height="74" rx="10" fill="var(--card)" stroke="var(--rule-strong)" stroke-width="1.5"/>
45
- <text data-p="measure" x="340" y="50" text-anchor="middle" font-size="14" font-weight="600" fill="var(--ink)">2. Client Measurement</text>
46
- <text data-p="measure" x="340" y="72" text-anchor="middle" font-size="12" fill="var(--muted)">Fit wide figures &amp; TOC</text>
47
- <path d="M444 55 H466" stroke="var(--muted)" stroke-width="1.5"/>
48
- <rect data-p="dark" x="472" y="18" width="196" height="74" rx="10" fill="var(--card)" stroke="var(--rule-strong)" stroke-width="1.5"/>
49
- <text data-p="dark" x="570" y="50" text-anchor="middle" font-size="14" font-weight="600" fill="var(--ink)">3. Dark Backing &amp; Zoom</text>
50
- <text data-p="dark" x="570" y="72" text-anchor="middle" font-size="12" fill="var(--muted)">Pad #faf9f5 · Click to zoom</text>
39
+ <svg viewBox="0 0 560 195" xmlns="http://www.w3.org/2000/svg" font-family="var(--sans)" style="max-width: 380px; margin-inline: auto">
40
+ <rect data-p="sync" x="2" y="4" width="180" height="187" rx="16" fill="var(--card)" stroke="var(--rule-strong)" stroke-width="2.5"/>
41
+ <text data-p="sync" x="92" y="42" text-anchor="middle" font-size="24" font-weight="600" fill="var(--ink)">1. Build-time</text>
42
+ <text data-p="sync" x="92" y="72" text-anchor="middle" font-size="24" font-weight="600" fill="var(--ink)">Sizing</text>
43
+ <text data-p="sync" x="92" y="138" text-anchor="middle" font-size="24" fill="var(--muted)">Emit width /</text>
44
+ <text data-p="sync" x="92" y="167" text-anchor="middle" font-size="24" fill="var(--muted)">height &amp; --wl</text>
45
+ <path d="M183.5 97.5 H188.5" stroke="var(--muted)" stroke-width="2.5"/>
46
+ <rect data-p="measure" x="190" y="4" width="180" height="187" rx="16" fill="var(--card)" stroke="var(--rule-strong)" stroke-width="2.5"/>
47
+ <text data-p="measure" x="280" y="42" text-anchor="middle" font-size="24" font-weight="600" fill="var(--ink)">2. Client</text>
48
+ <text data-p="measure" x="280" y="72" text-anchor="middle" font-size="24" font-weight="600" fill="var(--ink)">Measurement</text>
49
+ <text data-p="measure" x="280" y="138" text-anchor="middle" font-size="24" fill="var(--muted)">Fit wide</text>
50
+ <text data-p="measure" x="280" y="167" text-anchor="middle" font-size="24" fill="var(--muted)">figures &amp; TOC</text>
51
+ <path d="M371.5 97.5 H376.5" stroke="var(--muted)" stroke-width="2.5"/>
52
+ <rect data-p="dark" x="378" y="4" width="180" height="187" rx="16" fill="var(--card)" stroke="var(--rule-strong)" stroke-width="2.5"/>
53
+ <text data-p="dark" x="468" y="42" text-anchor="middle" font-size="24" font-weight="600" fill="var(--ink)">3. Dark</text>
54
+ <text data-p="dark" x="468" y="72" text-anchor="middle" font-size="24" font-weight="600" fill="var(--ink)">Backing &amp;</text>
55
+ <text data-p="dark" x="468" y="102" text-anchor="middle" font-size="24" font-weight="600" fill="var(--ink)">Zoom</text>
56
+ <text data-p="dark" x="468" y="138" text-anchor="middle" font-size="24" fill="var(--muted)">Pad #faf9f5 ·</text>
57
+ <text data-p="dark" x="468" y="167" text-anchor="middle" font-size="24" fill="var(--muted)">Click to zoom</text>
51
58
  </svg>
52
59
  parts:
53
60
  - id: sync
@@ -113,7 +113,7 @@ Write ` | ` (with spaces on both sides) inside a title to split it across two li
113
113
 
114
114
  Transparent-background line drawings automatically get a warm paper backing in dark mode, so you do not need separate dark assets:
115
115
 
116
- ![Diagram of the 740px reading column, 1040px wide figure zone, and 1340px wide table zone (transparent-background dark-line SVG, backed with #faf9f5 in dark mode).](../assets/reading-layout.svg)
116
+ ![Diagram of the 740px reading column, 1040px wide figure zone, and 1340px wide table zone (transparent-background dark-line SVG, backed with #faf9f5 in dark mode).](../assets/reading-layout-en.svg)
117
117
 
118
118
  ## Wide Tables Expand Symmetrically
119
119
 
@@ -171,7 +171,7 @@ items:
171
171
  caption: Maximum width for wide multi-column tables expanding symmetrically on desktop
172
172
  ```
173
173
 
174
- See [Components Overview](/garden/en/components) in the sidebar for all 9 built-in components and their live examples.
174
+ See [Components Overview](/garden/en/components) in the sidebar for all 12 built-in components and their live examples.
175
175
 
176
176
  <h2 id="garden-admin-title">From Init to Daily Writing</h2>
177
177
 
@@ -0,0 +1,85 @@
1
+ ---
2
+ title: Component reference · card
3
+ navTitle: card
4
+ description: Summarize a paper, repository, or module in a card with metadata and numbered takeaways.
5
+ section: reference
6
+ order: 1
7
+ badge: card
8
+ ---
9
+
10
+ [← Component reference](/garden/en/reference) · [Usage: card](/garden/en/components/card)
11
+
12
+ ## Examples
13
+
14
+ ```garden card
15
+ title: SQLite Write-Ahead Logging
16
+ url: https://www.sqlite.org/wal.html
17
+ meta: Documentation · sqlite.org
18
+ description: Appends changes sequentially to a write-ahead log while readers continue reading the original database pages, reducing read-write contention.
19
+ points:
20
+ - Writes append to the end of the `-wal` file instead of overwriting database pages in place on commit.
21
+ - Readers record the current end-of-log mark to see a consistent snapshot without blocking concurrent writers.
22
+ - Background checkpoints copy log pages back into the main database file in batches once a threshold is reached.
23
+ ```
24
+
25
+ ```garden card
26
+ cards:
27
+ - url: https://openlibrary.org/
28
+ title: "Open Library: one page per book"
29
+ description: An open catalogue run by the Internet Archive, with editions and e-book loans.
30
+ image: /images/garden/ref-card-book.svg
31
+ alt: A closed book
32
+ source:
33
+ - https://openlibrary.org/
34
+ takeaway: "**Worth borrowing:** link the book's page when you pick, so everyone reads the same edition."
35
+ - url: https://www.gutenberg.org/
36
+ title: "Project Gutenberg: public-domain e-books"
37
+ description: E-books that have entered the public domain, free to download.
38
+ image: /images/garden/ref-card-lamp.svg
39
+ alt: A desk lamp
40
+ source:
41
+ - https://www.gutenberg.org/
42
+ - https://en.wikipedia.org/wiki/Project_Gutenberg
43
+ takeaway: "**Worth borrowing:** pick a public-domain book now and then, so people without a copy can join at once."
44
+ ```
45
+
46
+ ## Syntax
47
+
48
+ ````markdown
49
+ ```garden card
50
+ title: # recommended, heading
51
+ url: # optional, heading link
52
+ meta: # optional, subtitle
53
+ description: # summary (or text)
54
+ points: # key points (or items)
55
+ image: # optional, thumbnail
56
+ alt: # optional, alt text
57
+ source: # optional, source URL
58
+ site: # optional, site name
59
+ takeaway: # optional, takeaway
60
+ cards: # multi-card mode, same keys
61
+ - url: # card link
62
+ ```
63
+ ````
64
+
65
+ ## Fields
66
+
67
+ Fence header: ` ```garden card ` (snippet trigger `;gcard`). Place fields at the top level for a single card, or pass a `cards` array for multiple horizontal row cards; invalid YAML or unknown top-level keys report `garden-yaml` on the block.
68
+
69
+ | Field | Required | Default | Allowed Values & Limits | Description |
70
+ | :--- | :--- | :--- | :--- | :--- |
71
+ | `title` | Recommended | `url` | string | Card heading; falls back to `url` if omitted |
72
+ | `url` | Optional | `""` | full `https://` or `http://` URL | External link on the heading; renders `title` as plain text if omitted |
73
+ | `meta` | Optional | none | string | Subtitle or metadata line below the heading |
74
+ | `description` | One of `description`, `points`, or `cards` | `""` | string (alias `text`) | Summary paragraph supporting inline bold and code |
75
+ | `points` | One of `points`, `description`, or `cards` | `[]` | string[] or `{ title, text? }[]` (alias `items`; `2` to `4` points recommended, not checked) | Numbered list of takeaways below the summary |
76
+ | `image` | Optional | none | image path or Data URL | Card thumbnail |
77
+ | `alt` | Optional | `title` | string | Thumbnail alt text |
78
+ | `source` | Optional | none | URL, `{ url, site?, icon? }`, or array | Source chip appended to `description`; multiple sources collapse to the first domain plus `+N` (such as `gutenberg.org +1`). `icon` defaults to the build-time downloaded favicon, then the uppercase first letter of the registrable domain's main label (e.g. `en.wikipedia.org` uses `W`, `bbc.co.uk` uses `B`) |
79
+ | `site` | Optional | hostname of `url` without `www.` | string | Display name for the source site |
80
+ | `takeaway` | Optional | none | string | One-line takeaway separated by a top border at the bottom of the card (e.g. `"**Worth borrowing:** ..."`) |
81
+ | `cards` | Required for multi-card mode | none | object[] | Stack of horizontal row cards, each supporting `url`, `title`, `description` (or `text`), `image`, `alt`, `meta`, `source`, and `takeaway` |
82
+
83
+ ## Limits & errors
84
+
85
+ - Apart from the shared `garden-yaml`, this component has no error codes of its own; values marked "not checked" in the table never report an error.
@@ -0,0 +1,68 @@
1
+ ---
2
+ title: Component reference · chart
3
+ navTitle: chart
4
+ description: Render proportional horizontal bars with a built-in expandable data table underneath.
5
+ section: reference
6
+ order: 5
7
+ badge: chart
8
+ ---
9
+
10
+ [← Component reference](/garden/en/reference) · [Usage: chart](/garden/en/components/chart)
11
+
12
+ ## Examples
13
+
14
+ ```garden chart
15
+ title: Max Width by Layout Zone
16
+ xLabel: Layout Zone
17
+ yLabel: Max Width
18
+ unit: px
19
+ data:
20
+ - x: Prose Column
21
+ y: 740
22
+ - x: Wide Figure Zone
23
+ y: 1040
24
+ - x: Wide Table Zone
25
+ y: 1340
26
+ caption: Click "View data table" below to expand the full numeric table.
27
+ ```
28
+
29
+ ## Syntax
30
+
31
+ ````markdown
32
+ ```garden chart
33
+ type: # optional, bar only
34
+ title: # recommended, heading
35
+ data: # either this or series
36
+ - x: # name
37
+ y: # value
38
+ label: # optional, value label
39
+ x: # labels for series
40
+ series: # either this or data
41
+ - name: # optional, name
42
+ data: # numbers
43
+ unit: # optional, unit
44
+ xLabel: # optional, 1st column
45
+ yLabel: # optional, 2nd column
46
+ caption: # optional, caption
47
+ ```
48
+ ````
49
+
50
+ ## Fields
51
+
52
+ Fence header: ` ```garden chart ` (snippet trigger `;gchart`). Provide rows via `data: [{ x, y, label? }]` or column arrays via `x` + `series`; invalid YAML or unknown top-level keys report `garden-yaml` on the block.
53
+
54
+ | Field | Required | Default | Allowed Values & Limits | Description |
55
+ | :--- | :--- | :--- | :--- | :--- |
56
+ | `title` | Recommended | `"Chart"` for `aria-label` (no visible heading) | string | Heading above the chart |
57
+ | `data` | Either `data` or `series` | `[]` | `{ x, y, label? }[]` (at least `2` rows and `2` to `8` rows recommended, not checked) | Row entries where `x` is the row label, `y` is the numeric value, and `label` defaults to `y` + `unit` |
58
+ | `series` | Either `series` or `data` | none | `{ name?, data: number[] }[]` (at least `2` data points recommended, not checked) | Numeric series paired with an `x` label array (`series[0].data` is rendered) |
59
+ | `x` | Optional | `["1", "2", ...]` (1-based row numbers) | string or string[] | Category labels when using `series`, or first-column header string when `xLabel` is omitted |
60
+ | `type` | Optional | `"bar"` | `"bar"` | Chart type (horizontal bar chart) |
61
+ | `unit` | Optional | `""` | string | Unit suffix appended to values when `data[].label` is omitted |
62
+ | `xLabel` | Optional | string `x` or `"Item"` | string | Header for the first column of the expandable data table |
63
+ | `yLabel` | Optional | `"Value"` | string | Header for the second column of the expandable data table |
64
+ | `caption` | Optional | none | string | Caption below the chart |
65
+
66
+ ## Limits & errors
67
+
68
+ - Apart from the shared `garden-yaml`, this component has no error codes of its own; values marked "not checked" in the table never report an error.