@@ -9,8 +9,8 @@ content_type: concept
9
9
10
10
<!-- overview -->
11
11
12
- <!-- This page explains the custom Hugo shortcodes that can be used in Kubernetes markdown documentation. -->
13
- 本页面将介绍定制 Hugo 短代码 ,可以用于 Kubernetes markdown 文档书写。
12
+ <!-- This page explains the custom Hugo shortcodes that can be used in Kubernetes Markdown documentation. -->
13
+ 本页面将介绍 Hugo 自定义短代码 ,可以用于 Kubernetes Markdown 文档书写。
14
14
15
15
<!-- Read more about shortcodes in the [Hugo documentation](https://gohugo.io/content-management/shortcodes). -->
16
16
关于短代码的更多信息可参见 [ Hugo 文档] ( https://gohugo.io/content-management/shortcodes ) 。
@@ -20,31 +20,31 @@ content_type: concept
20
20
<!--
21
21
## Feature state
22
22
23
- In a markdown page (.md file) on this site, you can add a shortcode to display
23
+ In a Markdown page (.md file) on this site, you can add a shortcode to display
24
24
version and state of the documented feature.
25
25
-->
26
26
## 功能状态
27
27
28
- 在本站的 markdown 页面中,你可以加入短代码来展示所描述的功能特性的版本和状态。
28
+ 在本站的 Markdown 页面中,你可以加入短代码来展示所描述的功能特性的版本和状态。
29
29
30
30
<!--
31
31
### Feature state demo
32
32
33
- Below is a demo of the feature state snippet, which displays the feature as stable
34
- in Kubernetes version 1.10 .
33
+ Below is a demo of the feature state snippet, which displays the feature as stable
34
+ in the latest Kubernetes version.
35
35
-->
36
36
### 功能状态示例
37
37
38
- 下面是一个功能状态代码段的演示,表明这个功能已经在 Kubernetes v1.10 时就已经稳定了 。
38
+ 下面是一个功能状态代码段的演示,表明这个功能已经在最新版 Kubernetes 中稳定了 。
39
39
40
40
```
41
- {{</* feature-state for_k8s_version="v1.10" state="stable" */>}}
41
+ {{</* feature-state state="stable" */>}}
42
42
```
43
43
44
- <!-- Will render to: -->
44
+ <!-- Renders to: -->
45
45
会转换为:
46
46
47
- {{< feature-state for_k8s_version="v1.10" state="stable" >}}
47
+ {{< feature-state state="stable" >}}
48
48
49
49
<!-- The valid values for `state` are: -->
50
50
` state ` 的可选值如下:
@@ -57,91 +57,42 @@ in Kubernetes version 1.10.
57
57
<!--
58
58
### Feature state code
59
59
60
- The displayed Kubernetes version defaults to that of the page or the site.
61
- This can be changed by passing the <code>for_k8s_version</code> shortcode
62
- parameter.
60
+ The displayed Kubernetes version defaults to that of the page or the site. You can change the
61
+ feature state version by passing the `for_k8s_version` shortcode parameter. For example:
63
62
-->
64
63
### 功能状态代码
65
64
66
65
所显示的 Kubernetes 默认为该页或站点版本。
67
- 可以通过修改 <code >for_k8s_version</code > 短代码参数来调整要显示的版本。
68
-
69
- ```
70
- {{</* feature-state for_k8s_version="v1.11" state="stable" */>}}
71
- ```
72
-
73
- <!-- Renders to: -->
74
- 会转换为:
75
-
76
- {{< feature-state for_k8s_version="v1.11" state="stable" >}}
77
-
78
- <!-- #### Alpha feature -->
79
- #### Alpha 功能
66
+ 修改 <code >for_k8s_version</code > 短代码参数可以调整要显示的版本。例如
80
67
81
68
```
82
- {{</* feature-state feature-state state="alpha " */>}}
69
+ {{</* feature-state for_k8s_version="v1.10" state="beta " */>}}
83
70
```
84
71
85
72
<!-- Renders to: -->
86
73
会转换为:
87
74
88
- {{< feature-state state="alpha" >}}
89
-
90
- <!-- #### Beta feature -->
91
- #### Beta 功能
92
-
93
- ```
94
- {{</* feature-state feature-state state="beta" */>}}
95
- ```
96
-
97
- <!-- Renders to: -->
98
- 会转换为:
99
-
100
- {{< feature-state state="beta" >}}
101
-
102
- <!-- #### Stable feature -->
103
- #### 稳定功能
104
-
105
- ```
106
- {{</* feature-state feature-state state="stable" */>}}
107
- ```
108
-
109
- <!-- Renders to: -->
110
- 会转换为:
111
-
112
- {{< feature-state state="stable" >}}
113
-
114
- <!-- #### Deprecated feature -->
115
- #### 废弃功能
116
-
117
- ```
118
- {{</* feature-state feature-state state="deprecated" */>}}
119
- ```
120
-
121
- <!-- Renders to: -->
122
- 会转换为:
123
-
124
- {{< feature-state state="deprecated" >}}
75
+ {{< feature-state for_k8s_version="v1.10" state="beta" >}}
125
76
126
77
<!--
127
78
## Glossary
128
- There are two glossary tooltips .
79
+ There are two glossary shortcodes: `glossary_tooltip` and `glossary_definition` .
129
80
130
81
You can reference glossary terms with an inclusion that will automatically
131
82
update and replace content with the relevant links from [our
132
- glossary](/docs/reference/glossary/). When the term is moused-over by someone
133
- using the online documentation, the glossary entry will display a tooltip .
83
+ glossary](/docs/reference/glossary/). When the glossary term is moused-over,
84
+ the glossary entry displays a tooltip. The glossary term also displays as a link .
134
85
135
86
As well as inclusions with tooltips, you can reuse the definitions from the glossary in
136
87
page content.
137
88
-->
138
89
## 词汇
139
90
140
- 有两种词汇表提示。
91
+ 有两种词汇表提示: ` glossary_tooltip ` 和 ` glossary_definition ` 。
141
92
142
93
你可以通过加入术语词汇的短代码,来自动更新和替换相应链接中的内容
143
94
([ 我们的词汇库] ( /zh/docs/reference/glossary/ ) )
144
- 这样,在浏览在线文档,鼠标移到术语上时,术语解释就会显示在提示框中 。
95
+ 在浏览在线文档时,术语会显示为超链接的样式,当鼠标移到术语上时,其解释就会显示在提示框中 。
145
96
146
97
除了包含工具提示外,你还可以重用页面内容中词汇表中的定义。
147
98
<!--
@@ -153,12 +104,12 @@ The raw data for glossary terms is stored at [https://github.com/kubernetes/webs
153
104
<!--
154
105
### Glossary demo
155
106
156
- For example, the following include within the markdown will render to
107
+ For example, the following include within the Markdown will render to
157
108
{{< glossary_tooltip text="cluster" term_id="cluster" >}} with a tooltip:
158
109
-->
159
110
### 词汇演示
160
111
161
- 例如,下面的代码在 markdown 中将会转换为 ` {{< glossary_tooltip text="cluster" term_id="cluster" >}} ` ,
112
+ 例如,下面的代码在 Markdown 中将会转换为 ` {{< glossary_tooltip text="cluster" term_id="cluster" >}} ` ,
162
113
然后在提示框中显示。
163
114
164
115
```
@@ -191,7 +142,6 @@ You can also include a full definition:
191
142
192
143
<!--
193
144
which renders as:
194
- {{< glossary_definition term_id="cluster" length="all" >}}
195
145
-->
196
146
呈现为:
197
147
{{< glossary_definition term_id="cluster" length="all" >}}
@@ -236,7 +186,7 @@ Parameter | Description | Default
236
186
{{< /table >}}
237
187
-->
238
188
239
- ```go-html-template
189
+ ``` go-html-template
240
190
{{</* table caption="配置参数" >}}
241
191
参数 | 描述 | 默认值
242
192
:---------|:------------|:-------
@@ -278,7 +228,7 @@ The `tabs` shortcode takes these parameters:
278
228
-->
279
229
## 标签页
280
230
281
- 在本站的 markdown 页面(` .md ` 文件)中,你可以加入一个标签页集来显示
231
+ 在本站的 Markdown 页面(` .md ` 文件)中,你可以加入一个标签页集来显示
282
232
某解决方案的不同形式。
283
233
284
234
标签页的短代码包含以下参数:
@@ -398,6 +348,120 @@ println "This is tab 2."
398
348
{{< tab name="JSON File" include="podtemplate.json" />}}
399
349
{{< /tabs >}}
400
350
351
+ <!--
352
+ ## Version strings
353
+
354
+ To generate a version string for inclusion in the documentation, you can choose from
355
+ several version shortcodes. Each version shortcode displays a version string derived from
356
+ the value of a version parameter found in the site configuration file, `config.toml`.
357
+ The two most commonly used version parameters are `latest` and `version`.
358
+ -->
359
+ ## 版本号信息
360
+
361
+ 要在文档中生成版本号信息,可以从以下几种短代码中选择。每个短代码可以基于站点配置文件
362
+ ` config.toml ` 中的版本参数生成一个版本号取值。最常用的参数为 ` latest ` 和 ` version ` 。
363
+
364
+ <!--
365
+ ### `{{</* param "version" */>}}`
366
+
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
369
+ the name of one site parameter, in this case: `version`.
370
+ -->
371
+ ### ` {{</* param "version" */>}} `
372
+
373
+ ` {{</* param "version" */>}} ` 短代码可以基于站点参数 ` version ` 生成 Kubernetes
374
+ 文档的当前版本号取值。短代码 ` param ` 允许传入一个站点参数名称,在这里是 ` version ` 。
375
+
376
+ <!--
377
+ {{< note >}}
378
+ In previously released documentation, `latest` and `version` parameter values are not equivalent.
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`.
382
+ {{< /note >}}
383
+ -->
384
+ {{< note >}}
385
+ 在先前已经发布的文档中,` latest ` 和 ` version ` 参数值并不完全等价。新版本文档发布后,参数
386
+ ` latest ` 会增加,而 ` version ` 则保持不变。例如,在上一版本的文档中使用 ` version ` 会得到
387
+ ` v1.19 ` ,而使用 ` latest ` 则会得到 ` v1.20 ` 。
388
+ {{< /note >}}
389
+
390
+ <!--
391
+ Renders to:
392
+ -->
393
+ 转换为:
394
+
395
+ {{< param "version" >}}
396
+
397
+ <!--
398
+ ### `{{</* latest-version */>}}`
399
+
400
+ The `{{</* latest-version */>}}` shortcode returns the value of the `latest` site parameter.
401
+ The `latest` site parameter is updated when a new version of the documentation is released.
402
+ This parameter does not always match the value of `version` in a documentation set.
403
+
404
+ Renders to:
405
+ -->
406
+ ### ` {{</* latest-version */>}} `
407
+
408
+ ` {{</* latest-version */>}} ` 返回站点参数 ` latest ` 的取值。每当新版本文档发布时,该参数均会被更新。
409
+ 因此,参数 ` latest ` 与 ` version ` 并不总是相同。
410
+
411
+ 转换为:
412
+
413
+ {{< latest-version >}}
414
+
415
+ <!--
416
+ ### `{{</* latest-semver */>}}`
417
+
418
+ The `{{</* latest-semver */>}}` shortcode generates the value of `latest` without the "v" prefix.
419
+
420
+ Renders to:
421
+ -->
422
+ ### ` {{</* latest-semver */>}} `
423
+
424
+ ` {{</* latest-semver */>}} ` 短代码可以生成站点参数 ` latest ` 不含前缀 ` v ` 的版本号取值。
425
+
426
+ 转换为:
427
+
428
+ {{< latest-semver >}}
429
+
430
+ <!--
431
+ ### `{{</* version-check */>}}`
432
+
433
+ The `{{</* version-check */>}}` shortcode checks if the `min-kubernetes-server-version`
434
+ page parameter is present and then uses this value to compare to `version`.
435
+
436
+ Renders to:
437
+ -->
438
+ ### ` {{</* version-check */>}} `
439
+
440
+ ` {{</* version-check */>}} ` 会检查是否设置了页面参数 ` min-kubernetes-server-version `
441
+ 并将其与 ` version ` 进行比较。
442
+
443
+ 转换为:
444
+
445
+ {{< version-check >}}
446
+
447
+ <!--
448
+ ### `{{</* latest-release-notes */>}}`
449
+
450
+ The `{{</* latest-release-notes */>}}` shortcode generates a version string from `latest` and removes
451
+ the "v" prefix. The shortcode prints a new URL for the release note CHANGELOG page with the modified
452
+ version string.
453
+
454
+ Renders to:
455
+ -->
456
+ ### ` {{</* latest-release-notes */>}} `
457
+
458
+ ` {{</* latest-release-notes */>}} ` 短代码基于站点参数 ` latest ` 生成不含前缀 ` v `
459
+ 的版本号取值,并输出该版本更新日志的超链接地址。
460
+
461
+ 转换为:
462
+
463
+ {{< latest-release-notes >}}
464
+
401
465
## {{% heading "whatsnext" %}}
402
466
403
467
<!--
@@ -408,9 +472,8 @@ println "This is tab 2."
408
472
* Learn about [advanced contributing](/docs/contribute/advanced/).
409
473
-->
410
474
411
- * 了解 [ Hugo] ( https://gohugo.io/ ) 。
475
+ * 了解[ Hugo] ( https://gohugo.io/ ) 。
412
476
* 了解[ 撰写新的话题] ( /zh/docs/contribute/style/write-new-topic/ ) 。
413
477
* 了解[ 使用页面内容类型] ( /zh/docs/contribute/style/page-content-types/ ) 。
414
478
* 了解[ 发起 PR] ( /zh/docs/contribute/new-content/open-a-pr/ ) 。
415
479
* 了解[ 高级贡献] ( /zh/docs/contribute/advanced/ ) 。
416
-
0 commit comments