@@ -358,36 +358,37 @@ The two most commonly used version parameters are `latest` and `version`.
358
358
-->
359
359
## 版本号信息
360
360
361
- 文档中的版本号信息可以通过短代码的方式生成。在配置文件 ` config.toml ` 中,定义了一些版本号信息,通过短代码及版本号参数可以从配置文件中提取并展示指定的版本号信息。
362
- 最常见的版本号短代码参数包括 ` latest ` 和 ` version ` 。
361
+ 要在文档中生成版本号信息,可以从以下几种短代码中选择。每个短代码可以基于站点配置文件
362
+ ` config.toml ` 中的版本参数生成一个版本号取值。最常用的参数为 ` latest ` 和 ` version ` 。
363
363
364
364
<!--
365
365
### `{{</* param "version" */>}}`
366
366
367
367
The `{{</* param "version" */>}}` shortcode generates the value of the current version of
368
- the Kubernetes documentation from the `version` site parameter. The `param` shortcode accepts the name of one site parameter, in this case: `version`.
368
+ the Kubernetes documentation from the `version` site parameter. The `param` shortcode accepts
369
+ the name of one site parameter, in this case: `version`.
369
370
-->
370
371
### ` {{</* param "version" */>}} `
371
372
372
- ` {{</* param "version" */>}} ` 短代码可以转换为 Kubernetes 文档的当前版本,具体的版本号来源于配置文件中的 ` version ` 参数。
373
- 短代码 ` param ` 允许传入一个配置参数,例子里的参数为 ` version ` 。
373
+ ` {{</* param "version" */>}} ` 短代码可以基于站点参数 ` version ` 生成 Kubernetes
374
+ 文档的当前版本号取值。 短代码 ` param ` 允许传入一个站点参数名称,在这里是 ` version ` 。
374
375
375
376
<!--
376
377
{{< note >}}
377
378
In previously released documentation, `latest` and `version` parameter values are not equivalent.
378
- After a new version is released, `latest` is incremented and the value of `version` for the documentation set remains unchanged. For example, a previously released version of the documentation displays `version` as
379
- `v1.19` and `latest` as `v1.20`.
379
+ After a new version is released, `latest` is incremented and the value of `version` for the
380
+ documentation set remains unchanged. For example, a previously released version of the
381
+ documentation displays `version` as `v1.19` and `latest` as `v1.20`.
380
382
{{< /note >}}
381
383
-->
382
384
{{< note >}}
383
- 在先前已经发布的文档中,` latest ` 和 ` version ` 参数转换得到的版本号并不相同。
384
- 新版本文档发布后,参数 ` latest ` 会增加,而 ` version ` 则保持不变。例如,在上一版本的文档中使用 ` version ` 会得到 ` v1.19 ` ,而使用 ` latest ` 则会得到 ` v1.20 ` 。
385
+ 在先前已经发布的文档中,` latest ` 和 ` version ` 参数值并不完全等价。新版本文档发布后,参数
386
+ ` latest ` 会增加,而 ` version ` 则保持不变。例如,在上一版本的文档中使用 ` version ` 会得到
387
+ ` v1.19 ` ,而使用 ` latest ` 则会得到 ` v1.20 ` 。
385
388
{{< /note >}}
386
389
387
390
<!--
388
391
Renders to:
389
-
390
- {{< param "version" >}}
391
392
-->
392
393
转换为:
393
394
@@ -401,12 +402,10 @@ The `latest` site parameter is updated when a new version of the documentation i
401
402
This parameter does not always match the value of `version` in a documentation set.
402
403
403
404
Renders to:
404
-
405
- {{< latest-version >}}
406
405
-->
407
406
### ` {{</* latest-version */>}} `
408
407
409
- ` {{</* latest-version */>}} ` 会转换为配置文件中参数 ` latest ` 对应的值。每当有新版本文档发布时,该参数均会更新 。
408
+ ` {{</* latest-version */>}} ` 返回站点参数 ` latest ` 的取值。每当新版本文档发布时,该参数均会被更新 。
410
409
因此,参数 ` latest ` 与 ` version ` 并不总是相同。
411
410
412
411
转换为:
@@ -419,12 +418,10 @@ Renders to:
419
418
The `{{</* latest-semver */>}}` shortcode generates the value of `latest` without the "v" prefix.
420
419
421
420
Renders to:
422
-
423
- {{< latest-semver >}}
424
421
-->
425
422
### ` {{</* latest-semver */>}} `
426
423
427
- ` {{</* latest-semver */>}} ` 会转换为配置文件中参数 ` latest ` 对应的值,并且会删除前缀 ` v ` 。
424
+ ` {{</* latest-semver */>}} ` 短代码可以生成站点参数 ` latest ` 不含前缀 ` v ` 的版本号取值 。
428
425
429
426
转换为:
430
427
@@ -437,12 +434,11 @@ The `{{</* version-check */>}}` shortcode checks if the `min-kubernetes-server-v
437
434
page parameter is present and then uses this value to compare to `version`.
438
435
439
436
Renders to:
440
-
441
- {{< version-check >}}
442
437
-->
443
438
### ` {{</* version-check */>}} `
444
439
445
- ` {{</* version-check */>}} ` 会检查是否设置了页面参数 ` min-kubernetes-server-version ` 并将其与 ` version ` 进行比较。
440
+ ` {{</* version-check */>}} ` 会检查是否设置了页面参数 ` min-kubernetes-server-version `
441
+ 并将其与 ` version ` 进行比较。
446
442
447
443
转换为:
448
444
@@ -452,15 +448,15 @@ Renders to:
452
448
### `{{</* latest-release-notes */>}}`
453
449
454
450
The `{{</* latest-release-notes */>}}` shortcode generates a version string from `latest` and removes
455
- the "v" prefix. The shortcode prints a new URL for the release note CHANGELOG page with the modified version string.
451
+ the "v" prefix. The shortcode prints a new URL for the release note CHANGELOG page with the modified
452
+ version string.
456
453
457
454
Renders to:
458
-
459
- {{< latest-release-notes >}}
460
455
-->
461
456
### ` {{</* latest-release-notes */>}} `
462
457
463
- ` {{</* latest-release-notes */>}} ` 会转换为 ` latest ` 版本的更新日志的超链接。
458
+ ` {{</* latest-release-notes */>}} ` 短代码基于站点参数 ` latest ` 生成不含前缀 ` v `
459
+ 的版本号取值,并输出该版本更新日志的超链接地址。
464
460
465
461
转换为:
466
462
0 commit comments