Convert site to Hugo (#8316)

This commit converts content and layout to use Hugo.
This commit is contained in:
Bjørn Erik Pedersen
2018-05-05 18:00:51 +02:00
committed by k8s-ci-robot
parent 7745f0e0c5
commit 7f3b633aa0
2327 changed files with 10928 additions and 171503 deletions
+45
View File
@@ -0,0 +1,45 @@
<!DOCTYPE html>
<html id="docs" lang="en" class="{{ .Params.class }}">
<head>
{{ partial "head.html" . }}
</head>
<body>
{{ partialCached "header.html" . "docs" }}
{{ block "hero" . }}
<!-- HERO -->
<section id="hero" class="light-text no-sub">
{{ partial "docs/top-menu.html" . }}
</section>
{{ end }}
{{ block "deprecation" . }}{{ partial "deprecation-warning.html" . }}{{ end }}
<section id="encyclopedia">
{{ block "side-menu" . }}<div id="docsToc" style="display:none;"></div>{{ end }}
<div id="{{ block "content-id" . }}docsContent{{ end }}">
{{ block "content" . }}{{ end }}
<div class="issue-button-container">
<p><a href=""><img src="https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/{{ .Path }}?pixel" alt="Analytics" /></a></p>
{{ if and (ne .Kind "404") (not (strings.Contains .Path "search")) }}
{{ if not .Params.no_issue }}
<script type="text/javascript">
PDRTJS_settings_8345992 = {
"id" : "8345992",
"unique_id" : "{{ .RelPermalink }}",
"title" : "{{ .Title }}",
"permalink" : "{{ .Permalink }}"
};
(function(d,c,j){if(!document.getElementById(j)){var pd=d.createElement(c),s;pd.id=j;pd.src=('https:'==document.location.protocol)?'https://polldaddy.com/js/rating/rating.js':'http://i0.poll.fm/js/rating/rating.js';s=document.getElementsByTagName(c)[0];s.parentNode.insertBefore(pd,s);}}(document,'script','pd-rating-js'));
</script>
<a href="" onclick="window.open('https://github.com/kubernetes/website/issues/new?title=Issue%20with%20' +
'k8s.io'+window.location.pathname)" class="button issue">Create an Issue</a>
{{ end }}
{{ end }}
{{ if not .Params.noedit }}
<a href="{{ printf "%s#%s" ("docs/editdocs" | relURL) .Path | safeURL }}" class="button issue">Edit this Page</a>
{{ end }}
</div>
</div>
</section>
{{ partialCached "footer.html" . }}
{{ partialCached "footer-scripts.html" . }}
</body>
</html>
+12
View File
@@ -0,0 +1,12 @@
{{ define "content" }}
{{ if not .Params.notitle }}
<h1>{{ .Title }}</h1>
{{ end }}
{{ .Content }}
{{ if .Params.track }}
{{ partial "docs/user-journey.html" . }}
{{ end }}
{{ end }}
{{ define "content-id" }}content{{ end }}
+96
View File
@@ -0,0 +1,96 @@
{{ define "content" }}
{{ if not .Params.notitle }}
<h1>{{ .Title }}</h1>
{{ end }}
{{ template "docs-portal-user-journey" . }}
{{ partial "docs/browse.html" (where .Parent.Sections ".Params.toc_hide" "!=" true) }}
{{ end }}
{{ define "content-id" }}content{{ end }}
{{ define "docs-portal-user-journey" }}
{{ $data := .Site.Data }}
<div id="user-persona-data" class="hide">
{{ $user_personas := index $data "user-personas" }}
{{ $user_personas | jsonify }}
</div>
<div class="hide">
{{ $skip_uj_paths := "migrators" }}
{{ range $k, $v := $user_personas }}
{{ if strings.Contains $skip_uj_paths $k }}
{{ else }}
{{ range $kk, $vv := $v }}
<div class="persona-def-data" data-name="{{ $kk }}">
{{ $persona_info := $vv }}
{{ if $persona_info.short_desc }}
{{ $persona_info.short_desc }}
{{ end }}
</div>
{{ end }}
{{ end }}
{{ end }}
</div>
<div id='aboutWrapper'>
<div class="aboutsection" markdown="1">
Kubernetes is an open source system for managing <a href="https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/">containerized applications</a> across multiple hosts, providing basic mechanisms for deployment, maintenance, and scaling of applications.
The open source project is hosted by the Cloud Native Computing Foundation (<a href="https://www.cncf.io/about">CNCF</a>).
<div class="aboutcolumn" markdown="1">
<a href="{{ "docs/imported/release/notes/" | relURL }}">Download Current Release</a>
</div>
<div class="aboutcolumn" markdown="1">
<a href="{{ "docs/home/supported-doc-versions/" | relURL }}">Supported Doc Versions</a>
</div>
</div>
</div>
<div class="paths">
<div class="navButton users">Users</div>
<div class="navButton contributors">Contributors</div>
<a> <div class="navButton browse">Browse Docs</div></a>
</div>
<div id="cardWrapper">
<div class="display-bar">I AM...</div>
<div class='cards' markdown="1">
<div class='docsection1' id='persona-definition'>.</div>
</div>
</div>
<div style='text-align: center;' class="applicationDeveloperContainer">
<div class="display-bar" id="subTitle">LEVEL</div>
<div class="levels">
<div class="level" data-name="foundational">
<i class="fa fa-sign-in" aria-hidden="true" style="font-size:50pt !important;padding-top:7% !important;padding-bottom:15% !important"></i>
<br>
<div class="tabbottom" style="padding-top:5%;padding-bottom:5%">
Foundational
</div>
</div>
<div class="level" data-name="intermediate">
<i class="fa fa-university" aria-hidden="true" style="font-size:50pt !important;padding-top:7% !important;padding-bottom:15% !important"></i>
<br>
<div class="tabbottom" style="padding-top:5%;padding-bottom:5%">
Intermediate
</div>
</div>
<div class="level" data-name="advanced">
<i class="fa fa-magic" aria-hidden="true" style="font-size:50pt !important;padding-top:7% !important;padding-bottom:15% !important"></i>
<br>
<div class="tabbottom" style="padding-top:5%;padding-bottom:5%">
Advanced Topics
</div>
</div>
</div>
</div>
<div class='infobarWrapper'>
<div class="infobar">
<span style="padding-bottom: 3% ">I want to...</span>
<div id="infobarLinks"></div>
</div>
</div>
{{ end }}
+56
View File
@@ -0,0 +1,56 @@
{{ define "side-menu" }}
{{ partial "docs/side-menu.html" . }}
{{ end }}
{{ define "content" }}
<h1>{{ .Title }}</h1>
<link href="{{ "css/glossary.css" | relURL }}" rel="stylesheet">
<script src="{{ "js/glossary.js" | relURL }}"></script>
<p>This glossary is intended to be a comprehensive, standardized list of Kubernetes terminology. It includes technical terms that are specific to K8s, as well as more general terms that provide useful context.</p>
<div id="tag-container">
<p>Filter terms according to their tags:</p>
<div class="tag-description invisible" id="placeholder">.</div>
{{ range (index .Site.Data "canonical-tags") }}
<div class="tag-description hide" id="{{ printf "tag-%s-description" .id }}">
<i>{{ .description }}</i>
</div>
{{ end }}
{{ $sorted_tags := sort (index .Site.Data "canonical-tags") "name" }}
{{ range $sorted_tags }}
{{ $full_tag_name := printf "tag-%s" .id }}
<span id="{{ $full_tag_name }}" class="tag-option canonical-tag" data-target="{{ $full_tag_name }}">
<a href="javascript:void(0)">{{ .name }}</a>
</span>
{{ end }}
<span class="tag-option"><a id="select-all-tags" href="javascript:void(0)">Select all</a></span>
<span class="tag-option"><a id="deselect-all-tags" href="javascript:void(0)">Deselect all</a></span>
</div>
<p>Click on the <a href="javascript:void(0)" class="no-underline">[+]</a> indicators below to get a longer explanation for any particular term.</p>
{{ $glossary_terms := (.Site.GetPage "page" "docs/reference/glossary").Resources.ByType "page" }}
{{ $glossary_terms := sort $glossary_terms "Title" "asc" }}
<ul>
{{ range $glossary_terms }}
{{ $.Scratch.Set "tag_classes" "" }}
{{ range .Params.tags }}
{{ $.Scratch.Add "tag_classes" (printf "tag-%s " .) }}
{{ end }}
{{ $term_identifier := (printf "term-%s" .Params.id) }}
<li class="{{ $.Scratch.Get "tag_classes" }} hide" data-show-count="0">
<div id="{{ $term_identifier }}" class="term-anchor"></div>
<div>
<div class="term-name"><b>{{ .Title }}</b><a href="{{ printf "#%s" $term_identifier }}" class="permalink hide">LINK</a></div>
{{ with .Params.aka }}
Also known as: <i>{{ delimit . ", " }}</i>
<br>
{{ end }}
<span class="preview-text">{{ .Summary }} <a href="javascript:void(0)" class="click-controller no-underline" data-target="{{ .Params.id }}">[+]</a></span>
<div id="{{ .Params.id }}" class="hide">
{{ .Content | strings.TrimPrefix .Summary | safeHTML }}
</div>
</div>
</li>
{{ end }}
</ul>
{{ end }}
+13
View File
@@ -0,0 +1,13 @@
{{ define "content" }}
{{ with .Content }}
{{ partial "docs/content_page" (dict "ctx" $ "page" $) }}
{{ else }}
{{ if ge (len .Pages) 1 }}
{{ $page := index .Pages 0 }}
{{ partial "docs/content_page" (dict "ctx" $ "page" $page) }}
{{ end }}
{{ end }}
{{ end }}
{{ define "side-menu" }}
{{ partial "docs/side-menu.html" . }}
{{ end }}
+25
View File
@@ -0,0 +1,25 @@
{{ define "content" }}
<h1>{{ .Title }}</h1>
<script type="text/javascript">
document.write('<gcse:searchresults-only linktarget="_parent"></gcse:searchresults-only>');
</script>
<script>
(function() {
var cx = '013288817511911618469:elfqqbqldzg';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
document.querySelector('html').classList.add('search');
})();
</script>
{{ end }}
+8
View File
@@ -0,0 +1,8 @@
{{ define "content" }}
{{ partial "docs/content_page" (dict "ctx" . "page" .) }}
{{ end }}
{{ define "side-menu" }}
{{ partial "docs/side-menu.html" . }}
{{ end }}