aboutsummaryrefslogtreecommitdiff
path: root/layouts/partials/docs
diff options
context:
space:
mode:
authorAlex Shpak <alex-shpak@users.noreply.github.com>2018-09-12 14:21:46 +0200
committerAlex Shpak <alex-shpak@users.noreply.github.com>2018-09-12 14:21:46 +0200
commitca37d7488c726452739da68f9a096e0d8467d264 (patch)
tree34a96d5d43ed46e18b43c2c672844868c54931ab /layouts/partials/docs
parent2e5e2a2f5c29f95c86b2966d9c38b33ba52a4195 (diff)
Fill theme.toml, refactor injection partials
Diffstat (limited to 'layouts/partials/docs')
-rw-r--r--layouts/partials/docs/html-head.html9
-rw-r--r--layouts/partials/docs/inject/body.html0
-rw-r--r--layouts/partials/docs/inject/head.html0
-rw-r--r--layouts/partials/docs/inject/nav-after.html0
-rw-r--r--layouts/partials/docs/inject/nav-before.html0
-rw-r--r--layouts/partials/docs/nav-brand.html3
-rw-r--r--layouts/partials/docs/nav-bundle.html8
-rw-r--r--layouts/partials/docs/nav-tree.html64
-rw-r--r--layouts/partials/docs/nav.html5
-rw-r--r--layouts/partials/docs/toc.html1
10 files changed, 90 insertions, 0 deletions
diff --git a/layouts/partials/docs/html-head.html b/layouts/partials/docs/html-head.html
new file mode 100644
index 0000000..bf7db42
--- /dev/null
+++ b/layouts/partials/docs/html-head.html
@@ -0,0 +1,9 @@
+<meta charset="UTF-8">
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,600" rel="stylesheet">
+<link href="/css/pure-min.css" rel="stylesheet">
+<!-- <link href="/css/grids-responsive-min.css" rel="stylesheet"> -->
+
+{{ $styles := resources.Get "styles.scss" | resources.ToCSS | resources.Minify | resources.Fingerprint }}
+<link rel="stylesheet" href="{{ $styles.Permalink }}"> \ No newline at end of file
diff --git a/layouts/partials/docs/inject/body.html b/layouts/partials/docs/inject/body.html
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/layouts/partials/docs/inject/body.html
diff --git a/layouts/partials/docs/inject/head.html b/layouts/partials/docs/inject/head.html
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/layouts/partials/docs/inject/head.html
diff --git a/layouts/partials/docs/inject/nav-after.html b/layouts/partials/docs/inject/nav-after.html
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/layouts/partials/docs/inject/nav-after.html
diff --git a/layouts/partials/docs/inject/nav-before.html b/layouts/partials/docs/inject/nav-before.html
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/layouts/partials/docs/inject/nav-before.html
diff --git a/layouts/partials/docs/nav-brand.html b/layouts/partials/docs/nav-brand.html
new file mode 100644
index 0000000..5a2c9cb
--- /dev/null
+++ b/layouts/partials/docs/nav-brand.html
@@ -0,0 +1,3 @@
+<h2 class="book-brand">
+ <a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
+</h2> \ No newline at end of file
diff --git a/layouts/partials/docs/nav-bundle.html b/layouts/partials/docs/nav-bundle.html
new file mode 100644
index 0000000..221325e
--- /dev/null
+++ b/layouts/partials/docs/nav-bundle.html
@@ -0,0 +1,8 @@
+<nav role="navigation">
+ {{ partial "docs/nav-brand" . }}
+ {{ partial "docs/inject/nav-before" . }}
+ {{ with .Site.GetPage .Site.Params.BookMenuBundle }}
+ {{- .Content -}}
+ {{ end }}
+ {{ partial "docs/inject/nav-after" . }}
+</nav>
diff --git a/layouts/partials/docs/nav-tree.html b/layouts/partials/docs/nav-tree.html
new file mode 100644
index 0000000..6d0a2d5
--- /dev/null
+++ b/layouts/partials/docs/nav-tree.html
@@ -0,0 +1,64 @@
+{{ $bookSection := default "docs" .Site.Params.BookSection }}
+{{ if eq $bookSection "*" }}
+ {{ .Scratch.Set "BookSections" .Site.Sections }}
+{{ else }}
+ {{ $bookSections := where .Site.Sections "Section" $bookSection }}
+ {{ .Scratch.Set "BookSections" $bookSections }}
+
+ {{ if eq (len $bookSections) 1 }}
+ {{ $singleSection := index $bookSections 0 }}
+ {{ .Scratch.Set "BookSections" $singleSection.Sections }}
+ {{ end }}
+
+{{ end }}
+
+<nav role="navigation">
+ {{ partial "docs/nav-brand" . }}
+ {{ partial "docs/inject/nav-before" . }}
+
+ <ul>
+ {{ range .Scratch.Get "BookSections" }}
+ {{ template "book-section" (dict "Section" . "CurrentPage" $.Permalink) }}
+ {{ end }}
+ </ul>
+
+ {{ partial "docs/inject/nav-after" . }}
+</nav>
+
+<!-- Single section of menu (recursive) -->
+{{ define "book-section" }}
+ <li {{ if .Section.Params.booktopsection }}class="book-nav-section"{{ end }}>
+ {{ template "book-heading" .Section }}
+ <ul>
+ {{ range .Section.Sections }}
+ {{ template "book-section" (dict "Section" . "CurrentPage" $.CurrentPage) }}
+ {{ end }}
+ {{ range .Section.Pages }}
+ <li>
+ <a href="{{ .RelPermalink }}" class="{{ if eq $.CurrentPage .Permalink }}active{{ end }}">
+ {{ default .Title (.File | humanize | title) }}
+ </a>
+ </li>
+ {{ end }}
+ </ul>
+ </li>
+{{ end }}
+
+<!-- Menu Heading -->
+{{ define "book-heading" }}
+
+{{ $sections := split (trim .Dir "/") "/" }}
+{{ $title := index ($sections | last 1) 0 | humanize | title }}
+{{ $title := default .Title $title }}
+
+{{ if .Content }}
+<a href="{{ .RelPermalink }}">
+ {{- $title -}}
+</a>
+{{ else }}
+<a>
+ {{- $title -}}
+</a>
+{{ end }}
+
+{{ end }}
diff --git a/layouts/partials/docs/nav.html b/layouts/partials/docs/nav.html
new file mode 100644
index 0000000..96bc233
--- /dev/null
+++ b/layouts/partials/docs/nav.html
@@ -0,0 +1,5 @@
+{{ if .Site.Params.BookMenuBundle }}
+ {{ partial "docs/nav-bundle" . }}
+{{ else }}
+ {{ partial "docs/nav-tree" . }}
+{{ end }} \ No newline at end of file
diff --git a/layouts/partials/docs/toc.html b/layouts/partials/docs/toc.html
new file mode 100644
index 0000000..aca3785
--- /dev/null
+++ b/layouts/partials/docs/toc.html
@@ -0,0 +1 @@
+{{ .Page.TableOfContents }} \ No newline at end of file