Skip to content

Commit 35ceb4d

Browse files
authored
Merge pull request #47415 from sftim/20240808_use_docsy_layout_for_community_page
Use Docsy-friendly layout for community page
2 parents 6f8ba89 + 542939a commit 35ceb4d

File tree

6 files changed

+127
-34
lines changed

6 files changed

+127
-34
lines changed

assets/scss/_custom.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,14 @@ body.glossary {
767767
}
768768
}
769769

770+
body.cid-community {
771+
section.linkbox {
772+
max-width: clamp(50%, calc(100em + 2vw), 100vw);
773+
margin-left: auto;
774+
margin-right: auto;
775+
}
776+
}
777+
770778
#caseStudies body > #deprecation-warning, body.cid-casestudies > #deprecation-warning, body.cid-community > #deprecation-warning {
771779
display: inline-block;
772780
vertical-align: top;
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: Kubernetes Community Code of Conduct
3+
body_class: code-of-conduct
4+
---
5+
6+
<a class="td-offset-anchor"></a>
7+
<section class="row td-box td-box--1 position-relative td-box--gradient td-box--height-auto">
8+
<div class="container text-center">
9+
<span class="h4 mb-0">
10+
<h1>Kubernetes Community Code of Conduct</h1>
11+
<p>
12+
Kubernetes follows the
13+
<a href="https://github.com/cncf/foundation/blob/main/code-of-conduct.md">CNCF Code of Conduct</a>.
14+
The text of the CNCF CoC is replicated below, as of
15+
<a href="https://github.com/cncf/foundation/blob/71412bb029090d42ecbeadb39374a337bfb48a9c/code-of-conduct.md">commit 71412bb02</a>.
16+
</p>
17+
<p>
18+
If you notice that this is out of date, please
19+
<a href="https://github.com/kubernetes/website/issues/new">file an issue</a>.
20+
</p>
21+
</span>
22+
</div>
23+
</section>
24+
25+
<div id="cncf-code-of-conduct">
26+
{{< include "/static/cncf-code-of-conduct.md" >}}
27+
</div>
28+
29+
<hr />
30+
31+
<p>
32+
If you notice a violation of the Code of Conduct at an event or meeting, in
33+
Slack, or in another communication mechanism, reach out to
34+
the <a href="https://git.k8s.io/community/committee-code-of-conduct">Kubernetes Code of Conduct Committee</a>.
35+
You can reach us by email at <a href="mailto:[email protected]">[email protected]</a>.
36+
Your anonymity will be protected.
37+
</p>

data/i18n/en/en.toml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,31 @@ other = "Cleaning up"
3434
[china_icp_license]
3535
other = "ICP license:"
3636

37-
[community_events_calendar]
37+
[community_advice_guidelines]
38+
other = "You can also read about our {{ .link }}."
39+
40+
[community_calendar_name]
3841
other = "Events Calendar"
3942

43+
# Also cover [community_contribute] if localizing this site
44+
45+
[community_contributor_site_name]
46+
other = "Contributor website"
47+
48+
# Also cover [community_develop] if localizing this site
49+
4050
[community_forum_name]
4151
other = "Forum"
4252

4353
[community_github_name]
4454
other = "GitHub"
4555

56+
# Also cover [community_introduce] if localizing this site
57+
58+
# Also cover [community_join] if localizing this site
59+
60+
# Also cover [community_learn] if localizing this site
61+
4662
[community_server_fault_name]
4763
other = "Server Fault"
4864

@@ -55,6 +71,8 @@ other = "Stack Overflow"
5571
[community_twitter_name]
5672
other = "X (formerly Twitter)"
5773

74+
# Also cover [community_using] if localizing this site
75+
5876
[community_x_name]
5977
other = "X (formerly Twitter)"
6078

hugo.toml

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ id = "UA-00000000-0"
127127
copyright_k8s = "The Kubernetes Authors"
128128
copyright_linux = "Copyright © 2020 The Linux Foundation ®."
129129

130+
contribution_guidelines_url = "https://www.kubernetes.dev/docs/contributor-cheatsheet/"
130131
# privacy_policy = "https://policies.google.com/privacy"
131132

132133
# First one is picked as the Twitter card image if not set on page.
@@ -243,53 +244,46 @@ no = 'Sorry to hear that. Please <a href="https://github.com/USERNAME/REPOSITORY
243244
[params.links]
244245
# End user relevant links. These will show up on left side of footer and in the community page if you have one.
245246
[[params.links.user]]
246-
name = "User mailing list"
247-
url = "https://discuss.kubernetes.io"
248-
icon = "fa fa-envelope"
249-
desc = "Discussion and help from your fellow users"
247+
name_key = "community_youtube_name"
248+
url = "https://youtube.com/kubernetescommunity"
249+
icon = "fab fa-youtube"
250250

251251
[[params.links.user]]
252-
name = "X(Twitter)"
253-
url = "https://twitter.com/kubernetesio"
254-
icon = "fab fa-x-twitter"
255-
desc = "Follow us on X (formerly Twitter) to get the latest news!"
252+
name_key = "community_forum_name"
253+
url = "https://discuss.kubernetes.io"
254+
icon = "fa fa-envelope"
256255

257256
[[params.links.user]]
258-
name = "Calendar"
259-
url = "https://calendar.google.com/calendar/embed?src=calendar%40kubernetes.io"
260-
icon = "fas fa-calendar-alt"
261-
desc = "Google Calendar for Kubernetes"
257+
name_key = "community_server_fault_name"
258+
url = "https://serverfault.com/questions/tagged/kubernetes"
259+
icon = "fab fa-stack-overflow"
262260

263261
[[params.links.user]]
264-
name = "Youtube"
265-
url = "https://youtube.com/kubernetescommunity"
266-
icon = "fab fa-youtube"
267-
desc = "Youtube community videos"
262+
name_key = "community_x_name"
263+
url = "https://twitter.com/kubernetesio"
264+
icon = "fab fa-twitter"
265+
# Replace with fa-x-twitter once available
268266

269267
# Developer relevant links. These will show up on right side of footer and in the community page if you have one.
270268
[[params.links.developer]]
271-
name = "GitHub"
269+
name_key = "community_contributor_site_name"
270+
url = "https://k8s.dev/"
271+
icon = "fas fa-laptop-code"
272+
273+
[[params.links.developer]]
274+
name_key = "community_github_name"
272275
url = "https://github.com/kubernetes/kubernetes"
273276
icon = "fab fa-github"
274-
desc = "Development takes place here!"
275277

276278
[[params.links.developer]]
277-
name = "Slack"
279+
name_key = "community_slack_name"
278280
url = "https://slack.k8s.io"
279281
icon = "fab fa-slack"
280-
desc = "Chat with other project developers"
281282

282283
[[params.links.developer]]
283-
name = "Contribute"
284-
url = "https://git.k8s.io/community/contributors/guide"
285-
icon = "fas fa-edit"
286-
desc = "Contribute to the Kubernetes website"
287-
288-
[[params.links.developer]]
289-
name = "Stack Overflow"
290-
url = "https://stackoverflow.com/questions/tagged/kubernetes"
291-
icon = "fab fa-stack-overflow"
292-
desc = "Practical questions and curated answers"
284+
name_key = "community_calendar_name"
285+
url = "https://calendar.google.com/calendar/embed?src=calendar%40kubernetes.io"
286+
icon = "fas fa-calendar-alt"
293287

294288
# Language definitions.
295289

layouts/community/list.html

Lines changed: 0 additions & 3 deletions
This file was deleted.

layouts/partials/community_links.html

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{{ $links := .Site.Params.links }}
2+
{{ $contributionGuidelines := "" }}
3+
{{- with index $links "community" -}}
4+
{{ range . }}
5+
{{ $contributionGuidelines := .url }}
6+
{{ break }}
7+
{{ end }}
8+
{{- end -}}
9+
10+
<section class="row td-box td-box--4 td-box--gradient td-box--height-auto linkbox">
11+
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
12+
<h2>{{ T "community_learn" }}</h2>
13+
<p>{{ T "community_using" . }}</p>
14+
{{ with index $links "user"}}
15+
{{ template "community-links-list" . }}
16+
{{ end }}
17+
</div>
18+
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
19+
<h2>{{ T "community_develop" }}</h2>
20+
<p>{{ T "community_contribute" . }}</p>
21+
{{ with index $links "developer"}}
22+
{{ template "community-links-list" . }}
23+
{{ end }}
24+
{{ with .Site.Params.contribution_guidelines_url }}
25+
<!-- https://k8s.dev/ did not support localization (as of 2024-08-12) -->
26+
<p>{{ T "community_advice_guidelines" (dict "link" (printf "<a href=\"%s\" target=\"_blank\">%s</a>" . ( T "community_guideline" ) ) ) | safeHTML }}</p>
27+
{{ end }}
28+
</div>
29+
</section>
30+
31+
{{ define "community-links-list" }}
32+
<ul>
33+
{{ range . }}
34+
<li title="{{ T .name_key }}">
35+
<a target="_blank" rel="noopener" href="{{ .url }}"><i class="{{ .icon }}"></i> {{ T .name_key }}</a>
36+
</li>
37+
{{ end }}
38+
</ul>
39+
{{ end }}

0 commit comments

Comments
 (0)