Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix search #82

Merged
merged 1 commit into from
Sep 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 77 additions & 1 deletion _includes/search.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,80 @@
{% if page.url != '/search.html' %}
{% if page.url == '/search.html' %}
<!-- // search.html page only -->
<style media="screen, print">
#search-results {
display: block;
position: static;
padding: 20px;
margin: 0;
border: 0;
width: 100%;
}
#search-results a {
color: #000;
text-decoration: none;
}
#search-results a:visited {
color: #000;
}
#search-results article, a {
width: 100%;
}
#search-results a {
display: block;
}
#search-results article:hover {
background-color: #e6e6e6;
}
#search-results h1 {
text-align: center;
}
</style>
{% raw %}
<script id="search-results-template" type="text/mustache">
<h1>Search results</h1>
{{#entries}}
<article>
<h3>
<a href="{{url}}">{{title}}</a>
</h3>
</article>
{{/entries}}
</script>
{% endraw %}
{% else %}
<!-- // every other page -->
<style media="screen, print">
#search-results {
position: absolute;
top: 44px;
right: 15px;
z-index: 10;
width: 288px;
max-height: 260px;
overflow-y: scroll;
padding: 0 10px 0 10px;
background-color: #fff;
border: 1px solid transparent;
border-radius: 4px;
box-shadow: 0 1px 1px rgba(0,0,0,.05);
}
#search-results a {
color: #000;
text-decoration: none;
}
#search-results a:visited {
color: #000;
}
#search-results article, a {
width: 100%;
}
#search-results a {
display: block;
}
#search-results article:hover {
background-color: #e6e6e6;
}
</style>
<form class="input-group" id="search" action="/search.html" method="get">
<input type="text" id="search-query" class="form-control" name="q" placeholder="Search" autocomplete="off">
<span class="input-group-btn">
Expand Down
14 changes: 1 addition & 13 deletions search.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,7 @@

<div class="panel panel-default">
<section id="search-results">
<div class="entries" style="font-size: 15px; display: block; position: static; padding: 0; margin: 0; border: 0; width: 100%;">
<div class="entries">
</div>
</section>
</div>

{% raw %}
<script id="search-results-template" type="text/mustache">
{{#entries}}
<article style="padding: 0; margin: 0;">
<h3>
<a href="{{url}}">{{title}}</a>
</h3>
</article>
{{/entries}}
</script>
{% endraw %}