Make k8s.io/docs/home to support i18n (#12570)

* Make k8s.io/docs/home to support i18n

* Apply kbhawkey's review comment
This commit is contained in:
June Yi
2019-02-22 01:24:20 +09:00
committed by Kubernetes Prow Robot
parent 22074f5848
commit 8e5d7e4829
31 changed files with 188 additions and 131 deletions
+34 -130
View File
@@ -2,144 +2,48 @@
{{ if not .Params.notitle }}
<h1>{{ .Title }}</h1>
{{ end }}
{{ if eq .Lang "en" }}
{{ template "docs-portal-cards" . }}
{{ end }}
{{ template "docs-portal-content" . }}
{{ end }}
{{ define "content-id" }}content{{ end }}
{{ define "docs-portal-cards" }}
<section id="mainContent">
{{ define "docs-portal-content" }}
<section id="mainContent">
<div class="launch-content">
<p>Kubernetes is an open source container orchestration engine for automating deployment, scaling, and management of containerized applications. The open source project is hosted by the Cloud Native Computing Foundation (<a href="https://www.cncf.io/about">CNCF</a>).</p>
<p>{{ .Params.overview | safeHTML }}</p>
<br>
<div class="launch-cards">
<div class="launch-card">
<h4>Understand the basics</h4>
<p>Learn about Kubernetes and its fundamental concepts.</p>
<br>
<ul>
<li><a href="/docs/concepts/overview/what-is-kubernetes/">What is Kubernetes?</a></li>
<li><a href="/docs/concepts/overview/components/">Kubernetes components</a></li>
<li><a href="/docs/concepts/overview/kubernetes-api/">The Kubernetes API</a></li>
<li><a href="/docs/concepts/overview/working-with-objects/kubernetes-objects/">Understanding Kubernetes objects</a></li>
<li><a href="/docs/concepts/workloads/pods/pod-overview/">Pod overview</a></li>
</ul>
<br><br>
<button id="btn-concepts" class="button" onClick="location.href='/docs/concepts/';">Learn Concepts</button>
</div>
<div class="launch-card">
<h4>Try Kubernetes</h4>
<p>Follow tutorials to learn how to deploy applications in Kubernetes.</p>
<br>
<ul>
<li><a href="/docs/tutorials/hello-minikube/">Hello Minikube</a></li>
<li><a href="/docs/tutorials/kubernetes-basics/">Walkthrough the basics</a></li>
<li><a href="/docs/tutorials/stateless-application/guestbook/">Stateless Example: PHP Guestbook with Redis</a></li>
<li><a href="/docs/tutorials/stateful-application/mysql-wordpress-persistent-volume/">Stateful Example: Wordpress with Persistent Volumes</a></li>
</ul>
<br><br>
<button id="btn-concepts" class="button" onClick="location.href='/docs/tutorials/';">View Tutorials</button>
</div>
<div class="launch-card">
<h4>Set up a cluster</h4>
<p>Get Kubernetes running based on your resources and needs.</p>
<br>
<ul>
<li><a href="/docs/setup/pick-right-solution/#hosted-solutions">Hosted Solutions</a></li>
<li><a href="/docs/setup/pick-right-solution/#turnkey-cloud-solutions">Turnkey Cloud Solutions</a></li>
<li><a href="/docs/setup/pick-right-solution/#on-premises-turnkey-cloud-solutions">On-Premises Solutions</a></li>
<li><a href="/docs/setup/pick-right-solution/#custom-solutions">Custom Solutions</a></li>
<li><a href="/docs/setup/pick-right-solution/#local-machine-solutions">Local Machine</a></li>
<li><a href="/docs/setup/independent/install-kubeadm/">Install the kubeadm setup tool</a></li>
</ul>
<br><br>
<button id="btn-concepts" class="button" onClick="location.href='/docs/setup/';">Set up Kubernetes</button>
</div>
<div class="launch-card">
<h4>Learn how to use Kubernetes</h4>
<p>Look up common tasks and how to perform them using a short sequence of steps.</p>
<br>
<ul>
<li><a href="/docs/tasks/tools/install-minikube/">Install Minikube</a></li>
<li><a href="/docs/tasks/tools/install-kubectl/">Install kubectl</a></li>
<li><a href="/docs/tasks/access-application-cluster/web-ui-dashboard/">Use the Web UI Dashboard</a></li>
<li><a href="/docs/tasks/access-application-cluster/configure-access-multiple-clusters/">Configure access to multiple clusters</a></li>
<li><a href="/docs/tasks/configure-pod-container/configure-pod-configmap/">Configure a Pod to use a ConfigMap</a></li>
</ul>
<br><br>
<button id="btn-concepts" class="button" onClick="location.href='/docs/tasks/';">View Tasks</button>
</div>
<div class="launch-card">
<h4>Look up reference information</h4>
<p>Browse terminology, command line syntax, API resource types, and setup tool documentation.</p>
<br>
<ul>
<li><a href="/docs/reference/glossary/?fundamental=true">Glossary</a></li>
<li><a href="/docs/reference/kubectl/overview/">Overview of kubectl</a></li>
<li><a href="/docs/reference/kubectl/cheatsheet/">kubectl cheat sheet</a></li>
<li><a href="/docs/reference/setup-tools/kubeadm/kubeadm/">Overview of kubeadm</a></li>
<li><a href="/docs/reference/using-api/api-overview/">Overview of API</a></li>
</ul>
<br><br>
<button id="btn-concepts" class="button" onClick="location.href='/docs/reference/';">View Reference</button>
</div>
<div class="launch-card">
<h4>Contribute to the docs</h4>
<p>Anyone can contribute, whether youre new to the project or youve been around a long time.</p>
<br>
<ul>
<li><a href="/docs/contribute/start/">Start contributing</a></li>
<li><a href="/docs/contribute/style/style-guide">Documentation style guide</a></li>
<li><a href="/docs/contribute/localization/">Translating the docs</a></li>
<li><a href="/docs/contribute/participating/">Participate in SIG Docs</a></li>
<li><a href="/docs/contribute/intermediate/">Intermediate contributing</a></li>
</ul>
<br><br>
<button id="btn-concepts" class="button" onClick="location.href='/docs/contribute/';">Contribute to the docs</button>
</div>
<div class="launch-card">
<h4>Download Kubernetes</h4>
<p>If you are installing Kubernetes or upgrading to the newest version, refer to the current release notes.</p>
<br>
<ul>
<li><a href="/docs/setup/release/notes/">Current release notes</a></li>
<li><a href="/docs/setup/release/notes/#urgent-upgrade-notes">Urgent upgrade notes</a></li>
<li><a href="/docs/setup/release/building-from-source/">Build from source code</a></li>
</ul>
</div>
<div class="launch-card">
<h4>About the documentation</h4>
<p>This website contains documentation for the current and previous 4 versions of Kubernetes.</p>
<br>
<ul>
<li><a href="/docs/home/supported-doc-versions/">Supported versions of the documentation</a></li>
</ul>
</div>
{{ template "docs-portal-card" . }}
</div>
</div>
</section>
{{ end }}
{{ define "docs-portal-card" }}
{{ range .Params.cards }}
<div class="launch-card">
<h4>{{ .title }}</h4>
<p>{{ .description }}</p>
<br>
<ul>
{{ $name := .name }}
{{ range where ($.Site.Pages.ByParam "card.weight") ".Params.card" "!=" nil }}
{{ if eq .Params.card.name $name }}
{{ $p := . }}
{{ if (isset .Params.card "anchors") }}
{{ range .Params.card.anchors }}
<li><a href="{{ $p.Permalink }}{{ .anchor }}">{{ .title }}</a></li>
{{ end }}
{{ else }}
<li><a href={{ .Permalink }}>
{{ if (isset .Params.card "title") }}{{ .Params.card.title }}{{ else }}{{ .LinkTitle }}{{ end }}
</a></li>
{{ end }}
{{ end }}
{{ end }}
</ul>
<br><br>
<button id="btn-concepts" class="button" onClick="location.href='{{ .button_path | relLangURL }}';">{{ .button }}</button>
</div>
{{ end }}
{{ end }}