Skip to content

Commit 84b3e5e

Browse files
committed
Add search frontmatter key to specify visibility of search
1 parent 0316c0c commit 84b3e5e

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

source/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ toc_footers:
1313
includes:
1414
- errors
1515

16+
search: true
1617
---
1718

1819
# Introduction

source/layouts/layout.erb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ under the License.
3838
<body class="<%= page_classes %>">
3939
<div class="tocify-wrapper">
4040
<%= image_tag "logo.png" %>
41-
<div class="search">
42-
<input type="text" class="search" id="input-search">
43-
</div>
44-
<div class="search-info"></div>
41+
<% if current_page.data.search %>
42+
<div class="search">
43+
<input type="text" class="search" id="input-search">
44+
</div>
45+
<div class="search-info"></div>
46+
<% end %>
4547
<div id="toc">
4648
</div>
4749
<% if current_page.data.toc_footers %>

source/stylesheets/screen.css.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ html, body {
8181
}
8282
}
8383

84+
img+.tocify {
85+
margin-top: $logo-margin;
86+
}
87+
8488
.search-info {
8589
margin-top: 0;
8690
padding: 1em $nav-padding;

source/stylesheets/variables.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ $lang-select-pressed-text: #fff; // color of language tab text when mouse is pre
5454
////////////////////
5555
$nav-width: 230px; // width of the navbar
5656
$examples-width: 50%; // portion of the screen taken up by code examples
57-
$logo-margin: 20px; // margin between nav items and logo
57+
$logo-margin: 20px; // margin between nav items and logo, ignored if search is active
5858
$main-padding: 28px; // padding to left and right of content & examples
5959
$nav-padding: 15px; // padding to left and right of navbar
6060
$nav-indent: 10px; // extra padding for ToC subitems

0 commit comments

Comments
 (0)