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/en/docs/contribute/style/content-guide.md
+7-10
Original file line number
Diff line number
Diff line change
@@ -17,8 +17,6 @@ You can register for Kubernetes Slack at https://slack.k8s.io/.
17
17
For information on creating new content for the Kubernetes
18
18
docs, follow the [style guide](/docs/contribute/style/style-guide).
19
19
20
-
21
-
22
20
<!-- body -->
23
21
24
22
## Overview
@@ -40,15 +38,19 @@ Kubernetes docs allow content for third-party projects only when:
40
38
41
39
### Third party content
42
40
43
-
Kubernetes documentation includes applied examples of projects in the Kubernetes project—projects that live in the [kubernetes](https://github.com/kubernetes) and
41
+
Kubernetes documentation includes applied examples of projects in the Kubernetes
42
+
project—projects that live in the [kubernetes](https://github.com/kubernetes) and
and [logging](/docs/concepts/cluster-administration/logging/).
50
51
51
-
Docs can link to third-party open source software (OSS) outside the Kubernetes project only if it's necessary for Kubernetes to function.
52
+
Docs can link to third-party open source software (OSS) outside the Kubernetes
53
+
project only if it's necessary for Kubernetes to function.
52
54
53
55
### Dual sourced content
54
56
@@ -59,19 +61,14 @@ Dual-sourced content requires double the effort (or more!) to maintain
59
61
and grows stale more quickly.
60
62
61
63
{{< note >}}
62
-
63
64
If you're a maintainer for a Kubernetes project and need help hosting your own docs,
64
65
ask for help in [#sig-docs on Kubernetes Slack](https://kubernetes.slack.com/messages/C1J0BPD2M/).
65
-
66
66
{{< /note >}}
67
67
68
68
### More information
69
69
70
70
If you have questions about allowed content, join the [Kubernetes Slack](https://slack.k8s.io/) #sig-docs channel and ask!
71
71
72
-
73
-
74
72
## {{% heading "whatsnext" %}}
75
73
76
-
77
74
* Read the [Style guide](/docs/contribute/style/style-guide).
Copy file name to clipboardExpand all lines: content/en/docs/contribute/style/content-organization.md
+39-31
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,10 @@ content_type: concept
4
4
weight: 90
5
5
---
6
6
7
-
8
7
<!-- overview -->
9
8
10
9
This site uses Hugo. In Hugo, [content organization](https://gohugo.io/content-management/organization/) is a core concept.
11
10
12
-
13
-
14
11
<!-- body -->
15
12
16
13
{{% note %}}
@@ -21,7 +18,9 @@ This site uses Hugo. In Hugo, [content organization](https://gohugo.io/content-m
21
18
22
19
### Page Order
23
20
24
-
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.
21
+
The documentation side menu, the documentation page browser etc. are listed using
22
+
Hugo's default sort order, which sorts by weight (from 1), date (newest first),
23
+
and finally by the link title.
25
24
26
25
Given that, if you want to move a page or a section up, set a weight in the page's front matter:
27
26
@@ -30,34 +29,36 @@ title: My Page
30
29
weight: 10
31
30
```
32
31
33
-
34
32
{{% note %}}
35
-
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.
36
-
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.
33
+
For page weights, it can be smart not to use 1, 2, 3 ..., but some other interval,
34
+
say 10, 20, 30... This allows you to insert pages where you want later.
35
+
Additionally, each weight within the same directory (section) should not be
36
+
overlapped with the other weights. This makes sure that content is always
37
+
organized correctly, especially in localized content.
37
38
{{% /note %}}
38
39
39
-
40
40
### Documentation Main Menu
41
41
42
-
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:
42
+
The `Documentation` main menu is built from the sections below `docs/` with
43
+
the `main_menu` flag set in front matter of the `_index.md` section content file:
43
44
44
45
```yaml
45
46
main_menu: true
46
47
```
47
48
48
-
49
-
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:
50
-
49
+
Note that the link title is fetched from the page's `linkTitle`, so if you want
50
+
it to be something different than the title, change it in the content file:
51
51
52
52
```yaml
53
53
main_menu: true
54
54
title: Page Title
55
55
linkTitle: Title used in links
56
56
```
57
57
58
-
59
58
{{% note %}}
60
-
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.
59
+
The above needs to be done per language. If you don't see your section in the menu,
60
+
it is probably because it is not identified as a section by Hugo. Create a
61
+
`_index.md`content file in the section folder.
61
62
{{% /note %}}
62
63
63
64
### Documentation Side Menu
@@ -72,11 +73,13 @@ If you don't want to list a section or page, set the `toc_hide` flag to `true` i
72
73
toc_hide: true
73
74
```
74
75
75
-
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.
76
+
When you navigate to a section that has content, the specific section or page
77
+
(e.g. `_index.md`) is shown. Else, the first page inside that section is shown.
76
78
77
79
### Documentation Browser
78
80
79
-
The page browser on the documentation home page is built using all the sections and pages that are directly below the `docs section`.
81
+
The page browser on the documentation home page is built using all the sections
82
+
and pages that are directly below the `docs section`.
80
83
81
84
If you don't want to list a section or page, set the `toc_hide` flag to `true` in front matter:
82
85
@@ -86,14 +89,18 @@ toc_hide: true
86
89
87
90
### The Main Menu
88
91
89
-
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.
90
-
92
+
The site links in the top-right menu -- and also in the footer -- are built by
93
+
page-lookups. This is to make sure that the page actually exists. So, if the
94
+
`case-studies`section does not exist in a site (language), it will not be linked to.
91
95
92
96
## Page Bundles
93
97
94
-
In addition to standalone content pages (Markdown files), Hugo supports [Page Bundles](https://gohugo.io/content-management/page-bundles/).
98
+
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.:
101
+
One example is [Custom Hugo Shortcodes](/docs/contribute/style/hugo-shortcodes/).
102
+
It is considered a `leaf bundle`. Everything below the directory, including the `index.md`,
103
+
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.
113
+
Another widely used example is the `includes` bundle. It sets `headless: true` in
114
+
front matter, which means that it does not get its own URL. It is only used in other pages.
107
115
108
116
```bash
109
117
en/includes
@@ -118,22 +126,22 @@ en/includes
118
126
119
127
Some important notes to the files in the bundles:
120
128
121
-
* For translated bundles, any missing non-content files will be inherited from languages above. This avoids duplication.
122
-
* 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).
123
-
* The value you get from `.RelPermalink` of a `Resource` is page-relative. See [Permalinks](https://gohugo.io/content-management/urls/#permalinks).
124
-
129
+
* For translated bundles, any missing non-content files will be inherited from
130
+
languages above. This avoids duplication.
131
+
* All the files in a bundle are what Hugo calls `Resources` and you can provide
132
+
metadata per language, such as parameters and title, even if it does not supports
133
+
front matter (YAML files etc.).
134
+
See [Page Resources Metadata](https://gohugo.io/content-management/page-resources/#page-resources-metadata).
135
+
* The value you get from `.RelPermalink` of a `Resource` is page-relative.
136
+
See [Permalinks](https://gohugo.io/content-management/urls/#permalinks).
125
137
126
138
## Styles
127
139
128
-
The [SASS](https://sass-lang.com/) source of the stylesheets for this site is stored in `assets/sass` and is automatically built by Hugo.
129
-
130
-
140
+
The [SASS](https://sass-lang.com/) source of the stylesheets for this site is
141
+
stored in `assets/sass` and is automatically built by Hugo.
131
142
132
143
## {{% heading "whatsnext" %}}
133
144
134
-
135
145
* Learn about [custom Hugo shortcodes](/docs/contribute/style/hugo-shortcodes/)
136
146
* Learn about the [Style guide](/docs/contribute/style/style-guide)
137
147
* Learn about the [Content guide](/docs/contribute/style/content-guide)
0 commit comments