Convert site to Hugo (#8316)
This commit converts content and layout to use Hugo.
This commit is contained in:
committed by
k8s-ci-robot
parent
7745f0e0c5
commit
7f3b633aa0
@@ -0,0 +1,21 @@
|
||||
<div class="panel-group" id="blog-archive">
|
||||
{{ range $i, $e := .CurrentSection.Pages.GroupByPublishDate "2006" }}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<a data-toggle="collapse" data-parent="#archive" href="#collapse-{{ .Key }}">
|
||||
{{ .Key }}</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="collapse-{{ .Key }}" class="panel-collapse collapse{{ if eq $i 0 }} in{{ end }}">
|
||||
<div class="panel-body">
|
||||
<ul class="list-group">
|
||||
{{ range .Pages }}
|
||||
<li class="list-group-item"><a href="{{ .Permalink }}">{{ .LinkTitle }}</a> <span class="date">{{ .PublishDate.Format "Jan 2" }}</span> </li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
@@ -0,0 +1,12 @@
|
||||
{{ if .Param "deprecated" }}
|
||||
<section id="deprecationWarning">
|
||||
<main>
|
||||
<div class="content deprecation-warning">
|
||||
<h3>
|
||||
Documentation for Kubernetes {{ .Param "version" }} is no longer actively maintained. The version you are currently viewing is a static snapshot.
|
||||
For up-to-date documentation, see the <a href="{{ .Site.Params.currentUrl }}">latest</a> version.
|
||||
</h3>
|
||||
</div>
|
||||
</main>
|
||||
</section>
|
||||
{{ end }}
|
||||
@@ -0,0 +1,39 @@
|
||||
|
||||
<div id='browsedocsWrapper'>
|
||||
<div class="browseheader" id="browsedocs">
|
||||
<a name="browsedocs">Browse Docs</a>
|
||||
</div>
|
||||
<div class="browsedocs">
|
||||
{{ range . }}
|
||||
{{ template "docs-browse-section" . }}
|
||||
{{ end }}
|
||||
</div><!-- end browsedocs -->
|
||||
|
||||
|
||||
{{ define "docs-browse-section" }}
|
||||
<div class="browsesection">
|
||||
<div class="docstitle">
|
||||
<h3><a href="{{ .RelPermalink }}">{{ .Params.bigheader | default .Title }}</a></h3>
|
||||
</div>
|
||||
{{ $pages := .Pages | union .Sections }}
|
||||
{{ $pages := where $pages ".Params.toc_hide" "!=" true }}
|
||||
{{ if ge (len $pages) 1 }}
|
||||
<div class="pages">
|
||||
{{ $num_pages := len $pages }}
|
||||
{{ if gt $num_pages 0 }}
|
||||
{{ $column_size := (div $num_pages 3) | math.Ceil | int | default 1 }}
|
||||
{{ range $i, $e := $pages.ByWeight }}
|
||||
{{ $offset := mod $i $column_size | add 1 }}
|
||||
{{ if eq $offset 1 }}
|
||||
<div class="browsecolumn">
|
||||
{{ end }}
|
||||
<a href="{{ .RelPermalink }}">{{ printf "%02d - %s" (add $i 1) .LinkTitle }}</a><br>
|
||||
{{ if or (eq $offset $column_size) (eq (add $i 1) $num_pages)}}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div><!-- end pages -->
|
||||
{{ end }}
|
||||
</div><!-- end browsesection -->
|
||||
{{ end }}
|
||||
@@ -0,0 +1,12 @@
|
||||
<p><a href="{{ printf "%s#%s" ("docs/editdocs" | relURL) .page.Path | safeURL }}" id="editPageButton">Edit This Page</a></p>
|
||||
{{ if not .page.Params.notitle }}
|
||||
<h1>{{ .page.Title }}</h1>
|
||||
{{ end }}
|
||||
{{ with .page.Params.content_template }}
|
||||
{{ partial . $ }}
|
||||
{{ else }}
|
||||
{{ if and (not .page.Params.toc_hide) (not (.page.HasShortcode "toc")) }}
|
||||
{{ .page.TableOfContents }}
|
||||
{{ end }}
|
||||
{{ .page.Content }}
|
||||
{{ end }}
|
||||
@@ -0,0 +1,24 @@
|
||||
<div id="docsToc">
|
||||
<div class="pi-accordion">
|
||||
{{/* This can be any page in the docs tree. Need to find the correct ancestor.
|
||||
In a roundabout way. This will improve when Go templates gets assignment and break support (both in Go 1.11).
|
||||
*/}}
|
||||
{{ $p := . }}
|
||||
{{ .Scratch.Set "section" .CurrentSection }}
|
||||
{{ .Scratch.Set "sectionFound" false }}
|
||||
{{ $docs := .Site.GetPage "section" "docs" }}
|
||||
{{ if ne .CurrentSection $docs }}
|
||||
{{ range $docs.Sections }}
|
||||
{{ if not ($.Scratch.Get "sectionFound") }}
|
||||
{{ if $p.IsDescendant . }}
|
||||
{{ $.Scratch.Set "section" . }}
|
||||
{{ $.Scratch.Set "sectionFound" true }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ $section := (.Scratch.Get "section") }}
|
||||
{{ partialCached "tree.html" $section $section.RelPermalink }}
|
||||
</div> <!-- /pi-accordion -->
|
||||
<button class="push-menu-close-button" onclick="kub.toggleToc()"></button>
|
||||
</div> <!-- /docsToc -->
|
||||
@@ -0,0 +1,21 @@
|
||||
{{ $p := . }}
|
||||
{{ $home := .Site.Home }}
|
||||
{{ $docs := .Site.GetPage "section" "docs" }}
|
||||
{{ $menuSections := (where $docs.Sections ".Params.main_menu" true) }}
|
||||
{{ range $menuSections }}
|
||||
{{ if $p.IsDescendant . }}
|
||||
<h1>{{ if not (strings.Contains .Dir "home")}}{{ .Params.bigheader | default .Title }}{{ end }}</h1>
|
||||
<h5>{{ .Params.abstract }}</h5>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<div id="vendorStrip" class="light-text">
|
||||
<ul>
|
||||
{{ range $menuSections }}
|
||||
{{ $yah := $p.IsDescendant . }}
|
||||
<li><a href="{{ .RelPermalink }}"{{ if $yah }} class="YAH"{{ end }}>{{ .LinkTitle | upper }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
<div id="searchBox">
|
||||
<input type="text" id="search" placeholder="Search" onkeydown="if (event.keyCode==13) window.location.replace('/docs/search/?q=' + this.value)" autofocus="autofocus">
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,22 @@
|
||||
<div class="track">{{ .Params.track }}</div>
|
||||
<div class="topheader">
|
||||
Introduction
|
||||
</div>
|
||||
<div class="sections">sections in this doc</div>
|
||||
<div id="user-journeys-toc" class="tablebar">
|
||||
<!-- This TOC section is populated with Javascript, see js/user-journeys-toc.js -->
|
||||
</div>
|
||||
|
||||
<div class="docsection1">
|
||||
|
||||
{{ partial "insert-capture" (dict "ctx" . "id" "overview" )}}
|
||||
|
||||
{{- with .Scratch.Get "__cid_body" -}}
|
||||
{{ $body := replace . `<h2` `</div><h2` }}
|
||||
{{ $body := replace $body `</h2>` `</h2><div class="docsection1">` | safeHTML }}
|
||||
{{- $body -}}
|
||||
{{- end -}}
|
||||
|
||||
</div>
|
||||
|
||||
<script src="{{ "js/user-journeys/toc.js" | relURL }}"></script>
|
||||
@@ -0,0 +1,42 @@
|
||||
<button class="flyout-button" onclick="kub.toggleToc()"></button>
|
||||
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||
ga('create', 'UA-36037335-10', 'auto');
|
||||
ga('send', 'pageview');
|
||||
|
||||
// hide docs nav area if no nav is present, or if nav only contains a link to the current page
|
||||
(function () {
|
||||
window.addEventListener('DOMContentLoaded', init)
|
||||
|
||||
// play nice with our neighbors
|
||||
function init() {
|
||||
window.removeEventListener('DOMContentLoaded', init)
|
||||
hideNav()
|
||||
}
|
||||
|
||||
function hideNav(toc){
|
||||
if (!toc) toc = document.querySelector('#docsToc')
|
||||
if (!toc) return
|
||||
var container = toc.querySelector('.container')
|
||||
|
||||
// container is built dynamically, so it may not be present on the first runloop
|
||||
if (container) {
|
||||
if (container.childElementCount === 0 || toc.querySelectorAll('a.item').length === 1) {
|
||||
toc.style.display = 'none'
|
||||
document.getElementById('docsContent').style.width = '100%'
|
||||
}
|
||||
} else {
|
||||
requestAnimationFrame(function () {
|
||||
hideNav(toc)
|
||||
})
|
||||
}
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
<!-- Commenting out AnswerDash for now; we need to work on our list of questions/answers/design first
|
||||
<!-- Start of AnswerDash script <script>var AnswerDash;!function(e,t,n,s,a){if(!t.getElementById(s)){var i,r=t.createElement(n),c=t.getElementsByTagName(n)[0];e[a]||(i=e[a]=function(){i.__oninit.push(arguments)},i.__oninit=[]),r.type="text/javascript",r.async=!0,r.src="https://p1.answerdash.com/answerdash.min.js?siteid=756",r.setAttribute("id",s),c.parentNode.insertBefore(r,c)}}(window,document,"script","answerdash-script","AnswerDash");</script> <!-- End of AnswerDash script -->
|
||||
@@ -0,0 +1,33 @@
|
||||
<footer>
|
||||
<main class="light-text">
|
||||
<nav>
|
||||
{{ with $.Site.GetPage "page" "docs/tutorials/stateless-application/hello-minikube" }}<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>{{ end }}
|
||||
{{ $sections := slice "docs/home" "blog" "partners" "community" "case-studies" }}
|
||||
{{ range $sections }}
|
||||
{{ with $.Site.GetPage "section" . }}<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>{{ end }}
|
||||
{{ end }}
|
||||
</nav>
|
||||
<div class="social">
|
||||
<div>
|
||||
<a href="https://twitter.com/kubernetesio" class="twitter"><span>twitter</span></a>
|
||||
<a href="https://github.com/kubernetes/kubernetes" class="github"><span>Github</span></a>
|
||||
<a href="http://slack.k8s.io/" class="slack"><span>Slack</span></a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="http://stackoverflow.com/questions/tagged/kubernetes" class="stack-overflow"><span>Stack Overflow</span></a>
|
||||
<a href="https://groups.google.com/forum/#!forum/kubernetes-users" class="mailing-list"><span>Mailing List</span></a>
|
||||
<a href="https://calendar.google.com/calendar/embed?src=nt2tcnbtbied3l6gi2h29slvc0%40group.calendar.google.com" class="calendar"><span>Events Calendar</span></a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="/docs/setup/pick-right-solution/" class="button">Get Kubernetes</a>
|
||||
<a href="https://github.com/kubernetes/kubernetes" class="button">Contribute</a>
|
||||
</div>
|
||||
</div>
|
||||
<div id="miceType" class="center">
|
||||
© {{ now.Year }} The Kubernetes Authors | Documentation Distributed under <a href="https://git.k8s.io/website/LICENSE" class="light-text">CC BY 4.0</a>
|
||||
</div>
|
||||
<div id="miceType" class="center">
|
||||
Copyright © {{ now.Year }} The Linux Foundation®. All rights reserved. The Linux Foundation has registered trademarks and uses trademarks. For a list of trademarks of The Linux Foundation, please see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text">Trademark Usage page</a>
|
||||
</div>
|
||||
</main>
|
||||
</footer>
|
||||
@@ -0,0 +1,35 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="shortcut icon" type="image/png" href="{{ "images/favicon.png" | relURL }}">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/css/base_fonts.css">
|
||||
{{ if .Params.case_study_styles }}<link rel="stylesheet" type="text/css" href="{{ "css/case_study_styles.css" | relURL }}"><!-- custom case_study_styles on -->{{ else }}<link rel="stylesheet" type="text/css" href="{{ "css/styles.css" | relURL }}"><!-- default styles.css on -->{{ end }}
|
||||
<link rel="stylesheet" type="text/css" href="https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css">
|
||||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="{{ "css/callouts.css" | relURL }}">
|
||||
<link rel="stylesheet" type="text/css" href="{{ "css/custom-jekyll/tags.css" | relURL }}">
|
||||
{{ if .Params.deprecated }}<link rel="stylesheet" type="text/css" href="{{ "css/deprecation-warning.css" | relURL }}">{{ end }}
|
||||
{{ if eq .Params.class "gridPage" }}<link rel="stylesheet" type="text/css" href="{{ "css/gridpage.css" | relURL }}">{{ end }}
|
||||
{{ with .Params.css }}{{ range (split . ",") }}<link rel="stylesheet" type="text/css" href="{{ (trim . " ") | relURL }}"><!-- custom css added -->
|
||||
{{ end }}{{ else }}<!-- no custom css detected -->{{ end }}
|
||||
{{ if .Params.description }}
|
||||
<meta name="description" content="{{ .Params.description }}" />
|
||||
{{ else }}
|
||||
<meta name="description" content="{{ .Params.title }}" />
|
||||
{{ end }}
|
||||
<script
|
||||
src="https://code.jquery.com/jquery-3.2.1.min.js"
|
||||
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
|
||||
crossorigin="anonymous"></script>
|
||||
<script
|
||||
src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"
|
||||
integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU="
|
||||
crossorigin="anonymous"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.js"></script>
|
||||
<script src="{{ "js/script.js" | relURL }}"></script>
|
||||
<script src="{{ "js/custom-jekyll/tags.js" | relURL }}"></script>
|
||||
{{ with .Params.js }}{{ range (split . ",") }}<script src="{{ (trim . " ") | relURL }}"></script><!-- custom js added -->
|
||||
{{ end }}{{ else }}<!-- no custom js detected -->{{ end }}
|
||||
</head>
|
||||
@@ -0,0 +1,79 @@
|
||||
<div id="cellophane" onclick="kub.toggleMenu()"></div>
|
||||
|
||||
<header>
|
||||
<a href="/" class="logo"></a>
|
||||
|
||||
<div class="nav-buttons" data-auto-burger="primary">
|
||||
<ul class="global-nav">
|
||||
{{ $sections := slice "docs/home" "blog" "partners" "community" "case-studies" }}
|
||||
{{ range $sections }}
|
||||
{{ with $.Site.GetPage "section" . }}<li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>{{ end }}
|
||||
{{ end }}
|
||||
{{ $home := .Site.Home }}
|
||||
<li>
|
||||
<a href="#">
|
||||
{{ $home.Language.LanguageName }} <span class="ui-icon ui-icon-carat-1-s"></span>
|
||||
</a>
|
||||
<ul>
|
||||
{{ range $home.Translations }}
|
||||
<li><a href="{{ .RelPermalink }}">{{ .Language.LanguageName }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#">
|
||||
{{ .Site.Params.version }} <span class="ui-icon ui-icon-carat-1-s"></span>
|
||||
</a>
|
||||
<ul>
|
||||
{{ range .Site.Params.versions }}
|
||||
<li><a href="{{ .url }}">{{ .version }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- <a href="/docs/home" class="button" id="viewDocs" data-auto-burger-exclude>View Documentation</a> -->
|
||||
<a href="/docs/tutorials/kubernetes-basics/" class="button" id="tryKubernetes" data-auto-burger-exclude>Try Kubernetes</a>
|
||||
<button id="hamburger" onclick="kub.toggleMenu()" data-auto-burger-exclude><div></div></button>
|
||||
</div>
|
||||
|
||||
<nav id="mainNav">
|
||||
<main data-auto-burger="primary">
|
||||
<div class="nav-box">
|
||||
<h3><a href="/docs/tutorials/stateless-application/hello-minikube/">Get Started</a></h3>
|
||||
<p>Ready to get your hands dirty? Build a simple Kubernetes cluster that runs "Hello World" for Node.js.</p>
|
||||
</div>
|
||||
<div class="nav-box">
|
||||
<h3><a href="/docs/home/">Documentation</a></h3>
|
||||
<p>Learn how to use Kubernetes with the use of walkthroughs, samples, and reference documentation. You can even <a href="/editdocs/" data-auto-burger-exclude>help contribute to the docs</a>!</p>
|
||||
</div>
|
||||
<div class="nav-box">
|
||||
<h3><a href="/community/">Community</a></h3>
|
||||
<p>If you need help, you can connect with other Kubernetes users and the Kubernetes authors, attend community events, and watch video presentations from around the web.</p>
|
||||
</div>
|
||||
<div class="nav-box">
|
||||
<h3><a href="/blog/">Blog</a></h3>
|
||||
<p>Read the latest news for Kubernetes and the containers space in general, and get technical how-tos hot off the presses.</p>
|
||||
</div>
|
||||
</main>
|
||||
<main data-auto-burger="primary">
|
||||
<div class="left">
|
||||
<h5 class="github-invite">Interested in hacking on the core Kubernetes code base?</h5>
|
||||
<a href="https://github.com/kubernetes/kubernetes" class="button" data-auto-burger-exclude>View On Github</a>
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
<h5 class="github-invite">Explore the community</h5>
|
||||
<div class="social">
|
||||
<a href="https://twitter.com/kubernetesio" class="twitter"><span>Twitter</span></a>
|
||||
<a href="https://github.com/kubernetes/kubernetes" class="github"><span>Github</span></a>
|
||||
<a href="http://slack.k8s.io/" class="slack"><span>Slack</span></a>
|
||||
<a href="http://stackoverflow.com/questions/tagged/kubernetes" class="stack-overflow"><span>Stack Overflow</span></a>
|
||||
<a href="https://groups.google.com/forum/#!forum/kubernetes-users" class="mailing-list"><span>Mailing List</span></a>
|
||||
<a href="https://calendar.google.com/calendar/embed?src=nt2tcnbtbied3l6gi2h29slvc0%40group.calendar.google.com" class="calendar"><span>Events Calendar</span></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clear" style="clear: both"></div>
|
||||
</main>
|
||||
</nav>
|
||||
</header>
|
||||
@@ -0,0 +1,4 @@
|
||||
{{- $capture_id := printf "__cid_%s" .id -}}
|
||||
{{- with .ctx.Scratch.Get $capture_id -}}
|
||||
{{- . -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,14 @@
|
||||
{{/* We need to initialize the shortcode's page's content. This is a very special construct. We are building page blocks by setting state on the Page,
|
||||
but we are not accessing its content. The .Content is lazily loaded in Hugo, so we must invoke that method before we do anything else. */}}
|
||||
{{ if .page.Content }}{{ end }}
|
||||
{{- $capture := printf "__cid_%s" .block -}}
|
||||
{{- $block := .page.Scratch.Get $capture -}}
|
||||
{{- if and (not $block) (not $.optional) -}}
|
||||
{{ partial "templates/errorthrower.html" (dict "block" .block "heading" .heading "purpose" .purpose) . }}
|
||||
{{- end -}}
|
||||
{{- with $block -}}
|
||||
{{- with $.heading }}
|
||||
<h2 id="{{ . | anchorize }}">{{ . }}</h2>
|
||||
{{ end -}}
|
||||
{{ . }}
|
||||
{{ end -}}
|
||||
@@ -0,0 +1,20 @@
|
||||
{{ .ctx.Scratch.Set "sections" slice }}
|
||||
<ul id="markdown-toc">
|
||||
{{ range .ctx.Scratch.Get "blocks" }}
|
||||
{{ if .content }}
|
||||
{{ $.ctx.Scratch.Set "section" .content }}
|
||||
{{ else}}
|
||||
{{ $.ctx.Scratch.Set "section" (partial "templates/block" .) }}
|
||||
{{ end }}
|
||||
{{ $section := $.ctx.Scratch.Get "section" }}
|
||||
{{ $headers := findRE "<h2.*?>(.|\n)*?</h2>" $section }}
|
||||
{{ range $headers }}
|
||||
{{ $header := . | replaceRE "</?h2.*?>" "" | htmlUnescape }}
|
||||
<li><a href="#{{ $header | anchorize }}">{{ $header }}</a></li>
|
||||
{{ end }}
|
||||
{{ $.ctx.Scratch.Add "sections" $section }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ range .ctx.Scratch.Get "sections" }}
|
||||
{{ . }}
|
||||
{{ end }}
|
||||
@@ -0,0 +1,8 @@
|
||||
{{ partial "templates/block" (dict "page" .page "block" "overview" "purpose" "states, in one or two sentences, the purpose of this document") }}
|
||||
|
||||
{{ .ctx.Scratch.Set "blocks" slice }}
|
||||
{{ .ctx.Scratch.Add "blocks" (dict "page" .page "block" "body" "purpose" "supplies the body of the page content.") }}
|
||||
{{ .ctx.Scratch.Add "blocks" (dict "content" .page.Content) }}
|
||||
{{ .ctx.Scratch.Add "blocks" (dict "page" .page "block" "whatsnext" "heading" "What's next" "optional" true ) }}
|
||||
|
||||
{{ partial "templates/blocks" . }}
|
||||
@@ -0,0 +1,14 @@
|
||||
<h2>ERROR</h2>
|
||||
|
||||
<p>You must define a <span style="font-family: monospace">{{ .block }}</span></p>
|
||||
|
||||
|
||||
<p>This template requires that you provide text that {{ .purpose }}. The text in this block will
|
||||
be displayed under the heading <b>{{ .heading }}</b>.
|
||||
|
||||
To get rid of this message and take advantage of this template, capture the <i>{{ .block }}</i> variable and populate it with content.
|
||||
|
||||
|
||||
<!-- TEMPLATE_ERROR -->
|
||||
|
||||
</p>
|
||||
@@ -0,0 +1,29 @@
|
||||
|
||||
<a href="#" id="feature-state-dialog-link" class="ui-state-default ui-corner-all"><span class="ui-icon ui-icon-newwin"></span>{{ .page.Title }}</a>
|
||||
<div id="feature-state-dialog" class="ui-dialog-content" title="{{ .page.Title }}">
|
||||
{{ .page.Content | markdownify }}
|
||||
</div>
|
||||
<script>
|
||||
$(function(){
|
||||
|
||||
$( "#feature-state-dialog" ).dialog({
|
||||
autoOpen: false,
|
||||
width: {{ .width | default "600" }},
|
||||
buttons: [
|
||||
{
|
||||
text: "Ok",
|
||||
click: function() {
|
||||
$( this ).dialog( "close" );
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
// Link to open the dialog
|
||||
$( "#feature-state-dialog-link" ).click(function( event ) {
|
||||
$( "#feature-state-dialog" ).dialog( "open" );
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,21 @@
|
||||
<div style="margin-top: 10px; margin-bottom: 10px;">
|
||||
{{ $for_k8s_version := .for_k8s_version | default (.page.Param "version") }}
|
||||
{{ $width := .width | default "600" }}
|
||||
{{ $state := .state }}
|
||||
<b>FEATURE STATE:</b> <code>Kubernetes {{ $for_k8s_version }}</code>
|
||||
{{/* docs/templates is a Hugo page bundle */}}
|
||||
{{ $templates_path := "docs/templates" }}
|
||||
{{ $templates := .page.Site.GetPage "page" $templates_path }}
|
||||
{{ with $templates.Resources }}
|
||||
{{ $template_path := printf "**feature-state-%s*" $state }}
|
||||
{{ $content_template := .GetMatch $template_path }}
|
||||
{{ with $content_template }}
|
||||
{{ $dialog := dict "page" $content_template "for_k8s_version" $for_k8s_version "width" $width }}
|
||||
{{ partial "templates/feature-dialog.html" $dialog }}
|
||||
{{ else }}
|
||||
{{ errorf "[%s] template not found in %s" .page.Site.Language.Lang $template_path }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ errorf "[%s] templates not found in docs/templates" .page.Site.Language.Lang }}
|
||||
{{ end }}
|
||||
</div>
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
{{ partial "templates/block" (dict "page" .page "block" "overview" "purpose" "states, in one or two sentences, the purpose of this document") }}
|
||||
|
||||
{{ .ctx.Scratch.Set "blocks" slice }}
|
||||
{{ .ctx.Scratch.Add "blocks" (dict "page" .page "block" "prerequisites" "heading" "Before you begin" "purpose" "lists action prerequisites and knowledge prerequisites.") }}
|
||||
{{ .ctx.Scratch.Add "blocks" (dict "page" .page "block" "steps" "purpose" "lists a sequence of numbered steps that accomplish the task.'") }}
|
||||
{{ .ctx.Scratch.Add "blocks" (dict "page" .page "block" "discussion" "optional" true ) }}
|
||||
{{ .ctx.Scratch.Add "blocks" (dict "content" .page.Content) }}
|
||||
{{ .ctx.Scratch.Add "blocks" (dict "page" .page "block" "whatsnext" "heading" "What's next" "optional" true ) }}
|
||||
|
||||
{{ partial "templates/blocks" . }}
|
||||
@@ -0,0 +1,12 @@
|
||||
{{ partial "templates/block" (dict "page" .page "block" "overview" "purpose" "states, in one or two sentences, the purpose of this document") }}
|
||||
|
||||
{{ .ctx.Scratch.Set "blocks" slice }}
|
||||
{{ .ctx.Scratch.Add "blocks" (dict "page" .page "block" "objectives" "heading" "Objectives" "purpose" "lists the objectives for this tutorial.") }}
|
||||
{{ .ctx.Scratch.Add "blocks" (dict "page" .page "block" "prerequisites" "heading" "Before you begin" "purpose" "lists action prerequisites and knowledge prerequisites.") }}
|
||||
{{ .ctx.Scratch.Add "blocks" (dict "page" .page "block" "lessoncontent" "purpose" "provides the lesson content for this tutorial.") }}
|
||||
{{ .ctx.Scratch.Add "blocks" (dict "content" .page.Content) }}
|
||||
{{ .ctx.Scratch.Add "blocks" (dict "page" .page "block" "cleanup" "heading" "Cleaning up" "optional" true ) }}
|
||||
{{ .ctx.Scratch.Add "blocks" (dict "page" .page "block" "whatsnext" "heading" "What's next" "optional" true ) }}
|
||||
|
||||
{{ partial "templates/blocks" . }}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
<div class="track">{{ .Params.track }}</div>
|
||||
<div class="topheader">
|
||||
Introduction
|
||||
</div>
|
||||
<div class="sections">sections in this doc</div>
|
||||
<div id="user-journeys-toc" class="tablebar">
|
||||
<!-- This TOC section is populated with Javascript, see js/user-journeys-toc.js -->
|
||||
</div>
|
||||
|
||||
<div class="docsection1">
|
||||
|
||||
{{ partial "templates/block" (dict "page" . "block" "overview" "purpose" "provides an introduction of this level.") }}
|
||||
|
||||
{{- $capture := printf "__cid_%s" "body" -}}
|
||||
{{- $body := .Scratch.Get $capture -}}
|
||||
{{ with $body }}
|
||||
{{ $b := replace $body "<h2" "</div><h2" }}
|
||||
{{ $b := replace $b "</h2>" "</h2><div class=\"docsection1\"" }}
|
||||
{{ $b }}
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
<script src="{{ "js/user-journeys/toc.js" | relURL }}"></script>
|
||||
@@ -0,0 +1,25 @@
|
||||
{{ $section := . }}
|
||||
<a class="item" data-title="{{ .LinkTitle }}" href="{{ .RelPermalink }}"></a>
|
||||
{{ template "section-tree-nav-pages" . }}
|
||||
{{ template "section-tree-nav" $section }}
|
||||
{{ define "section-tree-nav" }}
|
||||
{{ $sections := where .Sections ".Params.toc_hide" "!=" true }}
|
||||
{{ range $sections }}
|
||||
<div class="item" data-title="{{ .LinkTitle }}">
|
||||
<div class="container">
|
||||
{{ if ge (len .Content) 10 }}
|
||||
{{/* The section page has content, so link to it. */}}
|
||||
<a class="item" data-title="{{ .LinkTitle }}" href="{{ .RelPermalink }}"></a>
|
||||
{{ end }}
|
||||
{{ template "section-tree-nav-pages" . }}
|
||||
{{ template "section-tree-nav" . }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ define "section-tree-nav-pages" }}
|
||||
{{ range where .Pages ".Params.toc_hide" "!=" true }}
|
||||
<a class="item" data-title="{{ .LinkTitle }}" href="{{ .RelPermalink }}"></a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
Reference in New Issue
Block a user