You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/zh-cn/docs/contribute/style/content-guide.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,17 +71,21 @@ Kubernetes 网站(包括其文档)源代码位于
71
71
<!--
72
72
### Third party content
73
73
74
-
Kubernetes documentation includes applied examples of projects in the Kubernetes project—projects that live in the [kubernetes](https://github.com/kubernetes) and
74
+
Kubernetes documentation includes applied examples of projects in the Kubernetes
75
+
project—projects that live in the [kubernetes](https://github.com/kubernetes) and
Copy file name to clipboardExpand all lines: content/zh-cn/docs/contribute/style/content-organization.md
+43-20Lines changed: 43 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,9 @@ concept.
32
32
33
33
### Page Order
34
34
35
-
The documentation side menu, the documentation page browser etc. are listed using Hugo's default sort order, which sorts by weight (from 1), date (newest first), and finally by the link title.
35
+
The documentation side menu, the documentation page browser etc. are listed using
36
+
Hugo's default sort order, which sorts by weight (from 1), date (newest first),
37
+
and finally by the link title.
36
38
37
39
Given that, if you want to move a page or a section up, set a weight in the page's front matter:
38
40
-->
@@ -51,8 +53,11 @@ weight: 10
51
53
```
52
54
53
55
<!--
54
-
For page weights, it can be smart not to use 1, 2, 3 ..., but some other interval, say 10, 20, 30... This allows you to insert pages where you want later.
55
-
Additionally, each weight within the same directory (section) should not be overlapped with the other weights. This makes sure that content is always organized correctly, especially in localized content.
56
+
For page weights, it can be smart not to use 1, 2, 3 ..., but some other interval,
57
+
say 10, 20, 30... This allows you to insert pages where you want later.
58
+
Additionally, each weight within the same directory (section) should not be
59
+
overlapped with the other weights. This makes sure that content is always
60
+
organized correctly, especially in localized content.
@@ -64,7 +69,8 @@ Additionally, each weight within the same directory (section) should not be over
64
69
<!--
65
70
### Documentation Main Menu
66
71
67
-
The `Documentation` main menu is built from the sections below `docs/` with the `main_menu` flag set in front matter of the `_index.md` section content file:
72
+
The `Documentation` main menu is built from the sections below `docs/` with
73
+
the `main_menu` flag set in front matter of the `_index.md` section content file:
68
74
-->
69
75
### 文档主菜单
70
76
@@ -76,7 +82,8 @@ main_menu: true
76
82
```
77
83
78
84
<!--
79
-
Note that the link title is fetched from the page's `linkTitle`, so if you want it to be something different than the title, change it in the content file:
85
+
Note that the link title is fetched from the page's `linkTitle`, so if you want
86
+
it to be something different than the title, change it in the content file:
The above needs to be done per language. If you don't see your section in the menu, it is probably because it is not identified as a section by Hugo. Create a `_index.md` content file in the section folder.
97
+
The above needs to be done per language. If you don't see your section in the menu,
98
+
it is probably because it is not identified as a section by Hugo. Create a
99
+
`_index.md`content file in the section folder.
91
100
-->
92
101
{{< note >}}
93
102
你需要分别针对每种语言完成上述操作。如果在菜单中没有看到你的章节,这可能是因为它没有被 Hugo 识别为一个章节。
@@ -103,11 +112,12 @@ It will show all sections and their pages.
103
112
104
113
If you don't want to list a section or page, set the `toc_hide` flag to `true` in front matter:
105
114
106
-
When you navigate to a section that has content, the specific section or page (e.g. `_index.md`) is shown. Else, the first page inside that section is shown.
115
+
When you navigate to a section that has content, the specific section or page
116
+
(e.g. `_index.md`) is shown. Else, the first page inside that section is shown.
107
117
-->
108
118
### 文档侧方菜单
109
119
110
-
文档侧方菜单是基于 `docs/` 下面的**当前章节的内容树**构建的。
120
+
文档侧方菜单是基于 `docs/` 下面的**当前章节的内容树**构建的。
111
121
112
122
菜单默认显示所有的章节和它们的页面。
113
123
@@ -123,11 +133,12 @@ toc_hide: true
123
133
<!--
124
134
### Documentation Browser
125
135
126
-
The page browser on the documentation home page is built using all the sections and pages that are directly below the `docs section`.
136
+
The page browser on the documentation home page is built using all the sections
137
+
and pages that are directly below the `docs section`.
127
138
128
139
If you don't want to list a section or page, set the `toc_hide` flag to `true` in front matter:
129
140
-->
130
-
### 文档浏览器 {#documentation-browser}
141
+
### 文档浏览器 {#documentation-browser}
131
142
132
143
文档主页上的页面浏览器是基于 `docs section` 下一层的所有章节和页面构建的。
133
144
@@ -140,7 +151,9 @@ toc_hide: true
140
151
<!--
141
152
### The Main Menu
142
153
143
-
The site links in the top-right menu -- and also in the footer -- are built by page-lookups. This is to make sure that the page actually exists. So, if the `case-studies` section does not exist in a site (language), it will not be linked to.
154
+
The site links in the top-right menu -- and also in the footer -- are built by
155
+
page-lookups. This is to make sure that the page actually exists. So, if the
156
+
`case-studies`section does not exist in a site (language), it will not be linked to.
144
157
-->
145
158
### 主菜单
146
159
@@ -151,9 +164,12 @@ The site links in the top-right menu -- and also in the footer -- are built by p
151
164
<!--
152
165
## Page Bundles
153
166
154
-
In addition to standalone content pages (Markdown files), Hugo supports [Page Bundles](https://gohugo.io/content-management/page-bundles/).
167
+
In addition to standalone content pages (Markdown files), Hugo supports
One example is [Custom Hugo Shortcodes](/docs/contribute/style/hugo-shortcodes/). It is considered a `leaf bundle`. Everything below the directory, including the `index.md`, will be part of the bundle. This also includes page-relative links, images that can be processed etc.:
170
+
One example is [Custom Hugo Shortcodes](/docs/contribute/style/hugo-shortcodes/).
171
+
It is considered a `leaf bundle`. Everything below the directory, including the `index.md`,
172
+
will be part of the bundle. This also includes page-relative links, images that can be processed etc.:
Another widely used example is the `includes` bundle. It sets `headless: true` in front matter, which means that it does not get its own URL. It is only used in other pages.
192
+
Another widely used example is the `includes` bundle. It sets `headless: true` in
193
+
front matter, which means that it does not get its own URL. It is only used in other pages.
* For translated bundles, any missing non-content files will be inherited from languages above. This avoids duplication.
196
-
* All the files in a bundle are what Hugo calls `Resources` and you can provide metadata per language, such as parameters and title, even if it does not supports front matter (YAML files etc.). See [Page Resources Metadata](https://gohugo.io/content-management/page-resources/#page-resources-metadata).
197
-
* The value you get from `.RelPermalink` of a `Resource` is page-relative. See [Permalinks](https://gohugo.io/content-management/urls/#permalinks).
212
+
* For translated bundles, any missing non-content files will be inherited from
213
+
languages above. This avoids duplication.
214
+
* All the files in a bundle are what Hugo calls `Resources` and you can provide
215
+
metadata per language, such as parameters and title, even if it does not supports front
216
+
matter (YAML files etc.). See [Page Resources Metadata](https://gohugo.io/content-management/page-resources/#page-resources-metadata).
217
+
* The value you get from `.RelPermalink` of a `Resource` is page-relative.
218
+
See [Permalinks](https://gohugo.io/content-management/urls/#permalinks).
198
219
-->
199
220
有关包中文件的一些重要说明:
200
221
@@ -208,11 +229,13 @@ Some important notes to the files in the bundles:
208
229
<!--
209
230
## Styles
210
231
211
-
The [SASS](https://sass-lang.com/) source of the stylesheets for this site is stored in `assets/sass` and is automatically built by Hugo.
232
+
The [SASS](https://sass-lang.com/) source of the stylesheets for this site is
233
+
stored in `assets/sass` and is automatically built by Hugo.
212
234
-->
213
-
## 样式 {#styles}
235
+
## 样式 {#styles}
214
236
215
-
本网站的样式表的 [SASS](https://sass-lang.com/) 源文件存放在 `src/sass` 下面,并通过 Hugo 自动构建。
0 commit comments