hd-garden 0.13.1 → 0.13.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.
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/bin/garden.mjs +4 -0
- package/docs/handbook/components/file/checklist.md +1 -1
- package/docs/handbook/en/components/file/checklist.md +1 -1
- package/docs/handbook/en/reference/file/checklist.md +1 -1
- package/docs/handbook/en/start.md +3 -3
- package/docs/handbook/reference/file/checklist.md +1 -1
- package/docs/handbook/start.md +3 -3
- package/editors/dist/vscode/garden-ui-0.1.1.vsix +0 -0
- package/package.json +1 -1
- package/scripts/new-post.mjs +2 -2
- package/templates/site/README.en.md +2 -0
- package/templates/site/README.md +2 -0
package/README.en.md
CHANGED
|
@@ -73,7 +73,7 @@ Ask your Agent to compile the post using the bundled `garden-ui` skill: it runs
|
|
|
73
73
|
```bash
|
|
74
74
|
make new SLUG=writing-pace TITLE="Writing Pace" # Create a draft post in content/posts/
|
|
75
75
|
make dev # Sync content and start the local server
|
|
76
|
-
CONTENT_INCLUDE_DRAFTS=
|
|
76
|
+
CONTENT_INCLUDE_DRAFTS=0 make dev # Preview published posts only (optional)
|
|
77
77
|
make check # Run garden sync and garden build
|
|
78
78
|
make update MESSAGE="Add writing-pace post" # Check, commit, and push to origin
|
|
79
79
|
npx garden check content/posts/writing-pace.md # Validate front matter, components, and assets
|
package/README.md
CHANGED
|
@@ -75,7 +75,7 @@ Obsidian 插件这一轮不随包安装。
|
|
|
75
75
|
```bash
|
|
76
76
|
make new SLUG=writing-pace TITLE="慢慢写" # 在 content/posts/ 下创建文章草稿
|
|
77
77
|
make dev # 同步内容并启动本地预览
|
|
78
|
-
CONTENT_INCLUDE_DRAFTS=
|
|
78
|
+
CONTENT_INCLUDE_DRAFTS=0 make dev # 只预览已发布文章(可选)
|
|
79
79
|
make check # 运行 garden sync 与 garden build 验证全站
|
|
80
80
|
make update MESSAGE="新增一篇文章" # 检查通过后提交并推送到远端仓库
|
|
81
81
|
npx garden check content/posts/writing-pace.md # 单独检查一篇文章的标题、组件与资源路径
|
package/bin/garden.mjs
CHANGED
|
@@ -522,6 +522,10 @@ async function main() {
|
|
|
522
522
|
await sync();
|
|
523
523
|
break;
|
|
524
524
|
case "dev":
|
|
525
|
+
// Preview drafts by default, without overriding an explicit opt-out.
|
|
526
|
+
// Scoped to this CLI process: sync, Vinext and its watcher inherit it;
|
|
527
|
+
// later build/check commands do not.
|
|
528
|
+
process.env.CONTENT_INCLUDE_DRAFTS ??= "1";
|
|
525
529
|
ensureDevGitHubLogin();
|
|
526
530
|
await runVinext(["dev", ...rest]);
|
|
527
531
|
break;
|
|
@@ -14,4 +14,4 @@ Before running `make update` to push changes, verify the following items:
|
|
|
14
14
|
| :--- | :--- |
|
|
15
15
|
| `npx garden check content/posts/<slug>.md` | Checks a single post's component fields, code diffs, and local asset paths |
|
|
16
16
|
| `make check` | Runs `npx garden sync && npx garden build` to validate the full site build |
|
|
17
|
-
| `
|
|
17
|
+
| `make dev` | Previews drafts and scheduled posts locally |
|
|
@@ -14,4 +14,4 @@ Before running `make update` to push changes, verify the following items:
|
|
|
14
14
|
| :--- | :--- |
|
|
15
15
|
| `npx garden check content/posts/<slug>.md` | Checks a single post's component fields, code diffs, and local asset paths |
|
|
16
16
|
| `make check` | Runs `npx garden sync && npx garden build` to validate the full site build |
|
|
17
|
-
| `
|
|
17
|
+
| `make dev` | Previews drafts and scheduled posts locally |
|
|
@@ -59,10 +59,10 @@ make new DIR=network SLUG=tcp-bbr TITLE="TCP BBR Notes"
|
|
|
59
59
|
> [!NOTE] Note
|
|
60
60
|
> `SLUG` may only contain lowercase letters, digits, and hyphens (`a-z`, `0-9`, `-`), never `/`; pass subdirectories via `DIR`. `make new` reads only `SLUG`, `TITLE`, and `DIR`.
|
|
61
61
|
|
|
62
|
-
Newly created files default to `draft: true`.
|
|
62
|
+
Newly created files default to `draft: true`. `make dev` previews drafts and future-dated (`publishAt`) posts by default. Use `CONTENT_INCLUDE_DRAFTS=0 make dev` to opt out. Production builds still exclude them by default:
|
|
63
63
|
|
|
64
64
|
```bash
|
|
65
|
-
|
|
65
|
+
make dev
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
### Creating a Thought
|
|
@@ -76,7 +76,7 @@ The site `Makefile` and `garden` CLI provide these commands:
|
|
|
76
76
|
| Command | What It Runs |
|
|
77
77
|
| :--- | :--- |
|
|
78
78
|
| `make dev` | Runs `make prepare` to check dependencies, then runs `npx garden dev` (which syncs content and starts the dev server) |
|
|
79
|
-
| `CONTENT_INCLUDE_DRAFTS=
|
|
79
|
+
| `CONTENT_INCLUDE_DRAFTS=0 make dev` | Optional: preview published posts only, excluding drafts and future posts |
|
|
80
80
|
| `make new SLUG=xxx TITLE="Title" DIR=subdir` | Calls `npx garden new` to create a draft post under `content/posts/` (`DIR` is optional) |
|
|
81
81
|
| `make check` | Runs `npx garden sync && npx garden build` in the site repo to verify content sync and the production build |
|
|
82
82
|
| `npx garden check content/posts/xxx.md` | Checks a single Markdown post's title, component fields, code diffs, and local asset paths |
|
package/docs/handbook/start.md
CHANGED
|
@@ -59,10 +59,10 @@ make new DIR=network SLUG=tcp-bbr TITLE="TCP BBR 拥塞控制笔记"
|
|
|
59
59
|
> [!NOTE]
|
|
60
60
|
> `SLUG` 只能包含小写字母、数字和连字符(`a-z`、`0-9`、`-`),不能包含 `/`;子目录必须用 `DIR` 参数传入。`make new` 只读取 `SLUG`、`TITLE` 和 `DIR` 三个变量。
|
|
61
61
|
|
|
62
|
-
新建的文件默认带有 `draft: true
|
|
62
|
+
新建的文件默认带有 `draft: true`。`make dev` 默认预览草稿和未来定时文章(`publishAt`);用 `CONTENT_INCLUDE_DRAFTS=0 make dev` 可关闭。正式构建仍默认排除它们:
|
|
63
63
|
|
|
64
64
|
```bash
|
|
65
|
-
|
|
65
|
+
make dev
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
### 新建随想
|
|
@@ -76,7 +76,7 @@ CONTENT_INCLUDE_DRAFTS=1 make dev
|
|
|
76
76
|
| 命令 | 实际执行的操作 |
|
|
77
77
|
| :--- | :--- |
|
|
78
78
|
| `make dev` | 先执行 `make prepare` 检查依赖,再运行 `npx garden dev`(内部自动执行同步并启动开发服务器) |
|
|
79
|
-
| `CONTENT_INCLUDE_DRAFTS=
|
|
79
|
+
| `CONTENT_INCLUDE_DRAFTS=0 make dev` | 可选:只预览已发布文章,排除草稿和未来定时文章 |
|
|
80
80
|
| `make new SLUG=xxx TITLE="标题" DIR=子目录` | 调用 `npx garden new` 在 `content/posts/` 下生成新文章草稿(`DIR` 可省略) |
|
|
81
81
|
| `make check` | 在站点仓库中运行 `npx garden sync && npx garden build`,验证全站同步与生产构建 |
|
|
82
82
|
| `npx garden check content/posts/xxx.md` | 单独检查某篇 Markdown 文章的标题、组件字段、代码对比与本地附件路径 |
|
|
Binary file
|
package/package.json
CHANGED
package/scripts/new-post.mjs
CHANGED
|
@@ -67,12 +67,12 @@ async function main() {
|
|
|
67
67
|
if (lang === "en") {
|
|
68
68
|
console.log(`Created draft: ${path.relative(root, destination)}`);
|
|
69
69
|
console.log(`Post URL: /blog/${[...segments, slug].join("/")}/`);
|
|
70
|
-
console.log("Preview:
|
|
70
|
+
console.log("Preview: make dev");
|
|
71
71
|
console.log("Before publishing, fill in description, tags, and body, set draft to false, then run make update.");
|
|
72
72
|
} else {
|
|
73
73
|
console.log(`已创建草稿:${path.relative(root, destination)}`);
|
|
74
74
|
console.log(`文章路径:/blog/${[...segments, slug].join("/")}/`);
|
|
75
|
-
console.log("预览:
|
|
75
|
+
console.log("预览:make dev");
|
|
76
76
|
console.log("发布前请完善摘要、标签与正文,并将 draft 改为 false,再运行 make update。");
|
|
77
77
|
}
|
|
78
78
|
}
|
|
@@ -8,6 +8,8 @@ make new TITLE="Hello, World" SLUG=hello
|
|
|
8
8
|
make dev
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
`make dev`, `npm run dev`, and `npx garden dev` preview drafts and future scheduled posts by default. Opt out with `CONTENT_INCLUDE_DRAFTS=0 make dev`. Production builds exclude them by default.
|
|
12
|
+
|
|
11
13
|
Running `npx garden dev` for the first time fills in any missing `Makefile` or skills and creates `.env.local`. Cursor and Codex read `.agents/skills/` automatically when opening this repository. Run `npx garden skill` anytime to update the bundled skills.
|
|
12
14
|
|
|
13
15
|
`npx hd-garden init` copies the VS Code / Cursor and Typora Intelligent UI plugins into `.garden/editors/` and asks whether to install them when the terminal is interactive. Run `npx garden editors install` later (`--yes` installs both, `--vscode` or `--typora` installs one). Typora needs typora-community-plugin first; then enable the plugin under Settings, Installed plugins. Use the plugins to insert a plain `garden` brief for the `garden-ui` skill to compile, preview a component, and open the catalog. In Typora, type `/` and choose `/garden` to list each component with a small preview image. Hand `Compile this post:` to the skill when you want it compiled.
|
package/templates/site/README.md
CHANGED
|
@@ -8,6 +8,8 @@ make new TITLE="你好,世界" SLUG=hello
|
|
|
8
8
|
make dev
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
`make dev`、`npm run dev` 和 `npx garden dev` 默认预览草稿及未来定时文章。可用 `CONTENT_INCLUDE_DRAFTS=0 make dev` 关闭;正式构建默认排除这些内容。
|
|
12
|
+
|
|
11
13
|
第一次 `npx garden dev` 会补齐 Makefile 和 skill,并创建 `.env.local`。Cursor / Codex 打开这个仓库后会读到 `.agents/skills/`。要更新 skill,再运行 `npx garden skill`。
|
|
12
14
|
|
|
13
15
|
`npx hd-garden init` 会把 VS Code / Cursor 与 Typora 的 Intelligent UI 插件放到 `.garden/editors/`,并在交互终端里询问要不要安装。之后可以运行 `npx garden editors install`(加 `--yes` 则直接安装,`--vscode` / `--typora` 只装一个)。Typora 需要先装 typora-community-plugin,再在「设置 → 已安装插件」里勾选。插件用来插入想法(一段给 `garden-ui` skill 编译的 `garden` 围栏,不是写好的 YAML)、预览组件、打开清单,并把「编译这篇」交给 skill。Typora 里输入 `/` 选 `/garden`,再从带小预览图的列表里选。
|