@clarify-labs/templates 0.11.19 → 0.11.21

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.
@@ -23,6 +23,18 @@ keywords:
23
23
  # Writing content
24
24
  ```
25
25
 
26
+ ## Stable heading links
27
+
28
+ Add an explicit ID when a heading link must stay stable even if its visible title changes. This works in both `.md` and `.mdx` files.
29
+
30
+ ```mdx
31
+ ## 推荐:自动配置 {#auto-config}
32
+ ```
33
+
34
+ The explicit ID replaces the generated ID and becomes the heading's only fragment. IDs may contain lowercase ASCII letters, numbers, and single hyphens. If you omit the marker, Clarify keeps using the generated ID.
35
+
36
+ Invalid or duplicate final IDs are build errors that include the source location. Changing or removing an explicit ID breaks links that use the old fragment, just like renaming an automatically generated heading ID.
37
+
26
38
  ## Callouts
27
39
 
28
40
  <Callout title="Use callouts for important notes">
@@ -7,6 +7,18 @@ description: 学习如何在 Clarify 模板中组织多语言 MDX 页面。
7
7
 
8
8
  Clarify 会根据 `clarify.ts` 里的 `i18n.locales` 扫描语言目录。默认语言 `en-US` 直接渲染在根路径,其他语言会带上语言前缀,例如 `/zh-CN/guides/writing-content`。
9
9
 
10
+ ## 稳定的标题链接
11
+
12
+ 如果标题链接需要在显示文本变化后保持不变,请添加显式 ID。此语法同时适用于 `.md` 和 `.mdx` 文件。
13
+
14
+ ```mdx
15
+ ## 推荐:自动配置 {#auto-config}
16
+ ```
17
+
18
+ 显式 ID 会覆盖自动生成的 ID,并成为该标题唯一的 URL 片段。ID 只能包含小写 ASCII 字母、数字和单个连字符。省略该标记时,Clarify 仍使用自动生成的 ID。
19
+
20
+ 无效或重复的最终 ID 会导致构建失败,并报告源码位置。修改或删除显式 ID 会让使用旧片段的链接失效,这与重命名自动生成 ID 的标题一样,属于破坏性内容变更。
21
+
10
22
  ## 翻译一个页面
11
23
 
12
24
  如果英文页面位于:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clarify-labs/templates",
3
- "version": "0.11.19",
3
+ "version": "0.11.21",
4
4
  "license": "AGPL-3.0-only",
5
5
  "type": "module",
6
6
  "repository": {
@@ -23,6 +23,18 @@ keywords:
23
23
  # Writing content
24
24
  ```
25
25
 
26
+ ## Stable heading links
27
+
28
+ Add an explicit ID when a heading link must stay stable even if its visible title changes. This works in both `.md` and `.mdx` files.
29
+
30
+ ```mdx
31
+ ## 推荐:自动配置 {#auto-config}
32
+ ```
33
+
34
+ The explicit ID replaces the generated ID and becomes the heading's only fragment. IDs may contain lowercase ASCII letters, numbers, and single hyphens. If you omit the marker, Clarify keeps using the generated ID.
35
+
36
+ Invalid or duplicate final IDs are build errors that include the source location. Changing or removing an explicit ID breaks links that use the old fragment, just like renaming an automatically generated heading ID.
37
+
26
38
  ## Callouts
27
39
 
28
40
  <Callout title="Use callouts for important notes">