From b6d7a1050fe273869646242304899f0a0f1483b2 Mon Sep 17 00:00:00 2001
From: Alex Shpak <alex-shpak@users.noreply.github.com>
Date: Mon, 24 Sep 2018 17:03:23 +0200
Subject: Improve mobile UX

---
 layouts/docs/baseof.html                | 56 ++++++++++++++++-----------------
 layouts/partials/docs/header.html       |  6 ++++
 layouts/partials/docs/html-head.html    |  6 ++--
 layouts/partials/docs/nav-filetree.html |  2 +-
 4 files changed, 39 insertions(+), 31 deletions(-)
 create mode 100644 layouts/partials/docs/header.html

(limited to 'layouts')

diff --git a/layouts/docs/baseof.html b/layouts/docs/baseof.html
index 3a97228..94f8cd4 100644
--- a/layouts/docs/baseof.html
+++ b/layouts/docs/baseof.html
@@ -7,39 +7,39 @@
 </head>
 
 <body>
-  <div class="pure-g">
-
-    <div class="pure-u book-nav">
-      <nav role="navigation">
-        {{ partial "docs/nav-brand" . }}
-        {{ partial "docs/inject/nav-before" . }}
-        
-        {{ if .Site.Params.BookMenuBundle }}
-          {{ partial "docs/nav-bundle" . }}
-        {{ else }}
-          {{ partial "docs/nav-filetree" . }}
-        {{ end }}
-      
-        {{ partial "docs/inject/nav-after" . }}
-      </nav>
-    </div>
-    <div class="pure-u book-content">
-      <div class="pure-g">
-
-        <div class="pure-u book-page markdown">
-          {{- .Content -}}
-        </div>
-        {{ $showToC := default (default true .Site.Params.BookShowToC) .Params.bookshowtoc }}
-        {{ if and ($showToC) (.Page.TableOfContents) }}
-        <div class="pure-u book-toc">
-          {{ partial "docs/toc" . }}
-        </div>
-        {{ end }}
+  <div class="header">
+    {{ partial "docs/header" . }}
+  </div>
+  
+  <input type="checkbox" style="display: none" id="nav-control" />
+  <nav role="navigation" class="menu">
+    {{ partial "docs/inject/nav-before" . }}
+    
+    {{ if .Site.Params.BookMenuBundle }}
+      {{ partial "docs/nav-bundle" . }}
+    {{ else }}
+      {{ partial "docs/nav-filetree" . }}
+    {{ end }}
+  
+    {{ partial "docs/inject/nav-after" . }}
+  </nav>
 
+  <div>
+    
+    <div class="pure-g content">
+      <div class="pure-u-1 pure-u-lg-2-3 page markdown">
+        {{- .Content -}}
+      </div>
+      {{ $showToC := default (default true .Site.Params.BookShowToC) .Params.bookshowtoc }}
+      {{ if and ($showToC) (.Page.TableOfContents) }}
+      <div class="pure-u-1 pure-u-lg-1-3 pure-hidden-md toc">
+        {{ partial "docs/toc" . }}
       </div>
+      {{ end }}
     </div>
 
   </div>
+
   {{ partial "docs/inject/body" . }}
 </body>
 </html>
\ No newline at end of file
diff --git a/layouts/partials/docs/header.html b/layouts/partials/docs/header.html
new file mode 100644
index 0000000..aab1fcb
--- /dev/null
+++ b/layouts/partials/docs/header.html
@@ -0,0 +1,6 @@
+<label for="nav-control">
+  <img src="/svg/menu.svg" />
+</label>
+<h3>
+  <a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
+</h3>
\ No newline at end of file
diff --git a/layouts/partials/docs/html-head.html b/layouts/partials/docs/html-head.html
index e77c218..fe09dd0 100644
--- a/layouts/partials/docs/html-head.html
+++ b/layouts/partials/docs/html-head.html
@@ -3,8 +3,10 @@
 <title>{{- template "title" .  }} | {{ .Site.Title -}}</title>
 
 <link href="https://fonts.googleapis.com/css?family=Roboto+Mono|Roboto:300,400,700" rel="stylesheet">
-<link href="/css/pure-min.css" rel="stylesheet">
-<!-- <link href="/css/grids-responsive-min.css" rel="stylesheet"> -->
+<link rel="stylesheet" href="https://unpkg.com/purecss@1.0.0/build/base-min.css">
+<link rel="stylesheet" href="https://unpkg.com/purecss@1.0.0/build/grids-min.css">
+<link rel="stylesheet" href="https://unpkg.com/purecss@1.0.0/build/grids-responsive-min.css">
+
 
 {{ $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/nav-filetree.html b/layouts/partials/docs/nav-filetree.html
index 6c2f965..3ec4539 100644
--- a/layouts/partials/docs/nav-filetree.html
+++ b/layouts/partials/docs/nav-filetree.html
@@ -8,7 +8,7 @@
 {{ define "book-section" }} <!-- Single section of menu (recursive) -->
   <ul>
     {{ range .Section.Sections }}
-    <li>
+    <li {{- if .Params.bookrootsection}} class="root-section" {{ end }}>
       {{- if .Content -}}
         {{ template "book-page-link" (dict "Page" . "CurrentPage" $.CurrentPage) }}
       {{- else -}}
-- 
cgit v1.2.3