Skip to content

Commit 0c4389a

Browse files
authored
Merge pull request #10 from kubernetes/master
merge
2 parents c5f094c + b1f370d commit 0c4389a

File tree

500 files changed

+52546
-9929
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

500 files changed

+52546
-9929
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
name: Scheduled Netlify site build
3+
on:
4+
schedule: # Build twice daily: shortly after midnight and noon (UTC)
5+
# Offset is to be nice to the build service
6+
- cron: '4 0,12 * * *'
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Trigger build on Netlify
12+
env:
13+
TOKEN: ${{ secrets.NETLIFY_BUILD_HOOK_KEY }}
14+
run: >-
15+
curl -s -H "Accept: application/json" -H "Content-Type: application/json" -X POST -d "{}" "https://api.netlify.com/build_hooks/${TOKEN}"

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[submodule "themes/docsy"]
22
path = themes/docsy
33
url = https://github.com/google/docsy.git
4+
[submodule "api-ref-generator"]
5+
path = api-ref-generator
6+
url = https://github.com/kubernetes-sigs/reference-docs

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# change is that the Hugo version is now an overridable argument rather than a fixed
55
# environment variable.
66

7-
FROM alpine:latest
7+
FROM golang:1.15-alpine
88

99
LABEL maintainer="Luc Perkins <[email protected]>"
1010

Makefile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ docker-serve:
5858
@echo -e "$(CCRED)**** The use of docker-serve is deprecated. Use container-serve instead. ****$(CCEND)"
5959
$(MAKE) container-serve
6060

61-
container-image:
61+
container-image: ## Build a container image for the preview of the website
6262
$(CONTAINER_ENGINE) build . \
6363
--network=host \
6464
--tag $(CONTAINER_IMAGE) \
@@ -67,7 +67,7 @@ container-image:
6767
container-build: module-check
6868
$(CONTAINER_RUN) --read-only --mount type=tmpfs,destination=/tmp,tmpfs-mode=01777 $(CONTAINER_IMAGE) sh -c "npm ci && hugo --minify"
6969

70-
container-serve: module-check
70+
container-serve: module-check ## Boot the development server using container. Run `make container-image` before this.
7171
$(CONTAINER_RUN) --read-only --mount type=tmpfs,destination=/tmp,tmpfs-mode=01777 -p 1313:1313 $(CONTAINER_IMAGE) hugo server --buildFuture --bind 0.0.0.0 --destination /tmp/hugo --cleanDestinationDir
7272

7373
test-examples:
@@ -85,3 +85,10 @@ docker-internal-linkcheck:
8585
container-internal-linkcheck: link-checker-image-pull
8686
$(CONTAINER_RUN) $(CONTAINER_IMAGE) hugo --config config.toml,linkcheck-config.toml --buildFuture
8787
$(CONTAINER_ENGINE) run --mount type=bind,source=$(CURDIR),target=/test --rm wjdp/htmltest htmltest
88+
89+
clean-api-reference: ## Clean all directories in API reference directory, preserve _index.md
90+
rm -rf content/en/docs/reference/kubernetes-api/*/
91+
92+
api-reference: clean-api-reference ## Build the API reference pages. go needed
93+
cd api-ref-generator/gen-resourcesdocs && \
94+
go run cmd/main.go kwebsite --config-dir config/v1.20/ --file api/v1.20/swagger.json --output-dir ../../content/en/docs/reference/kubernetes-api --templates templates

OWNERS_ALIASES

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@ aliases:
77
- mrbobbytables
88
sig-docs-blog-reviewers: # Reviewers for blog content
99
- castrojo
10-
- cody-clark
1110
- kbarnard10
1211
- mrbobbytables
1312
- onlydole
14-
- parispittman
15-
- vonguard
1613
sig-docs-de-owners: # Admins for German content
1714
- bene2k1
1815
- mkorbi
@@ -30,6 +27,7 @@ aliases:
3027
- kbarnard10
3128
- kbhawkey
3229
- onlydole
30+
- reylejano
3331
- savitharaghunathan
3432
- sftim
3533
- steveperry-53
@@ -139,6 +137,7 @@ aliases:
139137
- seokho-son
140138
- ysyukr
141139
- pjhwa
140+
- yoonian
142141
sig-docs-leads: # Website chairs and tech leads
143142
- irvifa
144143
- jimangel
@@ -215,3 +214,12 @@ aliases:
215214
- idvoretskyi
216215
- MaxymVlasov
217216
- Potapy4
217+
# authoritative source: git.k8s.io/community/OWNERS_ALIASES
218+
committee-steering: # provide PR approvals for announcements
219+
- cblecker
220+
- derekwaynecarr
221+
- dims
222+
- liggitt
223+
- mrbobbytables
224+
- nikhita
225+
- parispittman

README-uk.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
```bash
1919
git clone https://github.com/kubernetes/website.git
2020
cd website
21-
hugo server --buildFuture
21+
git submodule update --init --recursive --depth 1
22+
make serve
2223
```
2324

2425
<!-- This will start the local Hugo server on port 1313. Open up your browser to http://localhost:1313 to view the website. As you make changes to the source files, Hugo updates the website and forces a browser refresh. -->
@@ -82,4 +83,4 @@ hugo server --buildFuture
8283
## Дякуємо!
8384

8485
<!-- Kubernetes thrives on community participation, and we appreciate your contributions to our website and our documentation! -->
85-
Долучення до спільноти - запорука успішного розвитку Kubernetes. Ми цінуємо ваш внесок у наш сайт і документацію!
86+
Долучення до спільноти - запорука успішного розвитку Kubernetes. Ми цінуємо ваш внесок у наш сайт і документацію!

README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
This repository contains the assets required to build the [Kubernetes website and documentation](https://kubernetes.io/). We're glad that you want to contribute!
66

7+
+ [Contributing to the docs](#contributing-to-the-docs)
8+
+ [Localization ReadMes](#localization-readmemds)
9+
710
# Using this repository
811

912
You can run the website locally using Hugo (Extended version), or you can run it in a container runtime. We strongly recommend using the container runtime, as it gives deployment consistency with the live website.
@@ -56,6 +59,49 @@ make serve
5659

5760
This will start the local Hugo server on port 1313. Open up your browser to http://localhost:1313 to view the website. As you make changes to the source files, Hugo updates the website and forces a browser refresh.
5861

62+
## Building the API reference pages
63+
64+
The API reference pages located in `content/en/docs/reference/kubernetes-api` are built from the Swagger specification, using https://github.com/kubernetes-sigs/reference-docs/tree/master/gen-resourcesdocs.
65+
66+
To update the reference pages for a new Kubernetes release (replace v1.20 in the following examples with the release to update to):
67+
68+
1. Pull the `kubernetes-resources-reference` submodule:
69+
70+
```
71+
git submodule update --init --recursive --depth 1
72+
```
73+
74+
2. Create a new API revision into the submodule, and add the Swagger specification:
75+
76+
```
77+
mkdir api-ref-generator/gen-resourcesdocs/api/v1.20
78+
curl 'https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/openapi-spec/swagger.json' > api-ref-generator/gen-resourcesdocs/api/v1.20/swagger.json
79+
```
80+
81+
3. Copy the table of contents and fields configuration for the new release from a previous one:
82+
83+
```
84+
mkdir api-ref-generator/gen-resourcesdocs/api/v1.20
85+
cp api-ref-generator/gen-resourcesdocs/api/v1.19/* api-ref-generator/gen-resourcesdocs/api/v1.20/
86+
```
87+
88+
4. Adapt the files `toc.yaml` and `fields.yaml` to reflect the changes between the two releases
89+
90+
5. Next, build the pages:
91+
92+
```
93+
make api-reference
94+
```
95+
96+
You can test the results locally by making and serving the site from a container image:
97+
98+
```
99+
make container-image
100+
make container-serve
101+
```
102+
103+
6. When all changes of the new contract are reflected into the configuration files `toc.yaml` and `fields.yaml`, create a Pull Request with the newly generated API reference pages.
104+
59105
## Troubleshooting
60106
### error: failed to transform resource: TOCSS: failed to transform "scss/main.scss" (text/x-scss): this feature is not available in your current Hugo version
61107

api-ref-generator

Submodule api-ref-generator added at ce97454

assets/scss/_custom.scss

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,3 +578,64 @@ body.td-documentation {
578578
color: black;
579579
text-decoration: none !important;
580580
}
581+
582+
@media print {
583+
/* Do not print announcements */
584+
#announcement, section#announcement, #fp-announcement, section#fp-announcement {
585+
display: none;
586+
}
587+
}
588+
589+
#announcement, #fp-announcement {
590+
> * {
591+
color: inherit;
592+
background: inherit;
593+
}
594+
595+
a {
596+
color: inherit;
597+
border-bottom: 1px solid #fff;
598+
}
599+
600+
a:hover {
601+
color: inherit;
602+
border-bottom: none;
603+
}
604+
}
605+
606+
#announcement {
607+
padding-top: 105px;
608+
padding-bottom: 25px;
609+
}
610+
611+
.header-hero {
612+
padding-top: 40px;
613+
}
614+
615+
/* Extra announcement height only for landscape viewports */
616+
@media (min-aspect-ratio: 8/9) {
617+
#fp-announcement {
618+
min-height: 25vh;
619+
}
620+
}
621+
622+
#fp-announcement aside {
623+
padding-top: 115px;
624+
padding-bottom: 25px;
625+
}
626+
627+
.announcement {
628+
.content {
629+
margin-bottom: 0px;
630+
}
631+
632+
633+
> p {
634+
.gridPage #announcement .content p,
635+
.announcement > h4,
636+
.announcement > h3 {
637+
color: #ffffff;
638+
}
639+
}
640+
}
641+

config.toml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ disableBrowserError = true
1313

1414
disableKinds = ["taxonomy", "taxonomyTerm"]
1515

16-
ignoreFiles = [ "^OWNERS$", "README[-]+[a-z]*\\.md", "^node_modules$", "content/en/docs/doc-contributor-tools" ]
16+
ignoreFiles = [ "(?:^|/)OWNERS$", "README[-]+[a-z]*\\.md", "^node_modules$", "content/en/docs/doc-contributor-tools" ]
1717

1818
timeout = 3000
1919

@@ -154,11 +154,6 @@ githubWebsiteRaw = "raw.githubusercontent.com/kubernetes/website"
154154
# GitHub repository link for editing a page and opening issues.
155155
github_repo = "https://github.com/kubernetes/website"
156156

157-
# param for displaying an announcement block on every page.
158-
# See /i18n/en.toml for message text and title.
159-
announcement = true
160-
announcement_bg = "#000000" #choose a dark color – text is white
161-
162157
#Searching
163158
k8s_search = true
164159

0 commit comments

Comments
 (0)