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
+39
View File
@@ -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 }}
+12
View File
@@ -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 }}
+24
View File
@@ -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 -->
+21
View File
@@ -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>
+22
View File
@@ -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>