From 84b3e5e3d6fcac7647d0190d4d35122359f45b48 Mon Sep 17 00:00:00 2001 From: Robert Lord Date: Mon, 21 Apr 2014 12:18:44 -0400 Subject: [PATCH] Add search frontmatter key to specify visibility of search --- source/index.md | 1 + source/layouts/layout.erb | 10 ++++++---- source/stylesheets/screen.css.scss | 4 ++++ source/stylesheets/variables.scss | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/source/index.md b/source/index.md index 6522143..bae295b 100644 --- a/source/index.md +++ b/source/index.md @@ -13,6 +13,7 @@ toc_footers: includes: - errors +search: true --- # Introduction diff --git a/source/layouts/layout.erb b/source/layouts/layout.erb index 513c8a1..1ea9cf1 100644 --- a/source/layouts/layout.erb +++ b/source/layouts/layout.erb @@ -38,10 +38,12 @@ under the License.
<%= image_tag "logo.png" %> - -
+ <% if current_page.data.search %> + +
+ <% end %>
<% if current_page.data.toc_footers %> diff --git a/source/stylesheets/screen.css.scss b/source/stylesheets/screen.css.scss index 44f9c71..7d9a656 100644 --- a/source/stylesheets/screen.css.scss +++ b/source/stylesheets/screen.css.scss @@ -81,6 +81,10 @@ html, body { } } + img+.tocify { + margin-top: $logo-margin; + } + .search-info { margin-top: 0; padding: 1em $nav-padding; diff --git a/source/stylesheets/variables.scss b/source/stylesheets/variables.scss index cc513f5..6e29c1c 100644 --- a/source/stylesheets/variables.scss +++ b/source/stylesheets/variables.scss @@ -54,7 +54,7 @@ $lang-select-pressed-text: #fff; // color of language tab text when mouse is pre //////////////////// $nav-width: 230px; // width of the navbar $examples-width: 50%; // portion of the screen taken up by code examples -$logo-margin: 20px; // margin between nav items and logo +$logo-margin: 20px; // margin between nav items and logo, ignored if search is active $main-padding: 28px; // padding to left and right of content & examples $nav-padding: 15px; // padding to left and right of navbar $nav-indent: 10px; // extra padding for ToC subitems