diff --git a/content/zh/docs/contribute/style/hugo-shortcodes/index.md b/content/zh/docs/contribute/style/hugo-shortcodes/index.md index fba8d98258..b1d156951b 100644 --- a/content/zh/docs/contribute/style/hugo-shortcodes/index.md +++ b/content/zh/docs/contribute/style/hugo-shortcodes/index.md @@ -358,36 +358,37 @@ The two most commonly used version parameters are `latest` and `version`. --> ## 版本号信息 -文档中的版本号信息可以通过短代码的方式生成。在配置文件 `config.toml` 中,定义了一些版本号信息,通过短代码及版本号参数可以从配置文件中提取并展示指定的版本号信息。 -最常见的版本号短代码参数包括 `latest` 和 `version`。 +要在文档中生成版本号信息,可以从以下几种短代码中选择。每个短代码可以基于站点配置文件 +`config.toml` 中的版本参数生成一个版本号取值。最常用的参数为 `latest` 和 `version`。 ### `{{}}` -`{{}}` 短代码可以转换为 Kubernetes 文档的当前版本,具体的版本号来源于配置文件中的 `version` 参数。 -短代码 `param` 允许传入一个配置参数,例子里的参数为 `version`。 +`{{}}` 短代码可以基于站点参数 `version` 生成 Kubernetes +文档的当前版本号取值。短代码 `param` 允许传入一个站点参数名称,在这里是 `version`。 {{< note >}} -在先前已经发布的文档中,`latest` 和 `version` 参数转换得到的版本号并不相同。 -新版本文档发布后,参数 `latest` 会增加,而 `version` 则保持不变。例如,在上一版本的文档中使用 `version` 会得到 `v1.19`,而使用 `latest` 则会得到 `v1.20`。 +在先前已经发布的文档中,`latest` 和 `version` 参数值并不完全等价。新版本文档发布后,参数 +`latest` 会增加,而 `version` 则保持不变。例如,在上一版本的文档中使用 `version` 会得到 +`v1.19`,而使用 `latest` 则会得到 `v1.20`。 {{< /note >}} 转换为: @@ -401,12 +402,10 @@ The `latest` site parameter is updated when a new version of the documentation i This parameter does not always match the value of `version` in a documentation set. Renders to: - -{{< latest-version >}} --> ### `{{}}` -`{{}}` 会转换为配置文件中参数 `latest` 对应的值。每当有新版本文档发布时,该参数均会更新。 +`{{}}` 返回站点参数 `latest` 的取值。每当新版本文档发布时,该参数均会被更新。 因此,参数 `latest` 与 `version` 并不总是相同。 转换为: @@ -419,12 +418,10 @@ Renders to: The `{{}}` shortcode generates the value of `latest` without the "v" prefix. Renders to: - -{{< latest-semver >}} --> ### `{{}}` -`{{}}` 会转换为配置文件中参数 `latest` 对应的值,并且会删除前缀 `v`。 +`{{}}` 短代码可以生成站点参数 `latest` 不含前缀 `v` 的版本号取值。 转换为: @@ -437,12 +434,11 @@ The `{{}}` shortcode checks if the `min-kubernetes-server-v page parameter is present and then uses this value to compare to `version`. Renders to: - -{{< version-check >}} --> ### `{{}}` -`{{}}` 会检查是否设置了页面参数 `min-kubernetes-server-version` 并将其与 `version` 进行比较。 +`{{}}` 会检查是否设置了页面参数 `min-kubernetes-server-version` +并将其与 `version` 进行比较。 转换为: @@ -452,15 +448,15 @@ Renders to: ### `{{}}` The `{{}}` shortcode generates a version string from `latest` and removes -the "v" prefix. The shortcode prints a new URL for the release note CHANGELOG page with the modified version string. +the "v" prefix. The shortcode prints a new URL for the release note CHANGELOG page with the modified +version string. Renders to: - -{{< latest-release-notes >}} --> ### `{{}}` -`{{}}` 会转换为 `latest` 版本的更新日志的超链接。 +`{{}}` 短代码基于站点参数 `latest` 生成不含前缀 `v` +的版本号取值,并输出该版本更新日志的超链接地址。 转换为: