Skip to content

Commit

Permalink
Merge pull request #231 from samvera/test-google-search-box
Browse files Browse the repository at this point in the history
Test switching to google search box
  • Loading branch information
laritakr committed May 11, 2018
2 parents 8ad44a4 + e824361 commit 0967790
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 32 deletions.
2 changes: 1 addition & 1 deletion _includes/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="col-lg-12 footer">
&copy;{{ site.time | date: "%Y" }} {{site.company_name}}. All rights reserved. <br />
{% if page.last_updated %}<span>Page last updated:</span> {{page.last_updated}}<br/>{% endif %} Site last generated: {{ site.time | date: "%b %-d, %Y" }} <br />
<p><img src="{{ "images/company_logo.png" }}" alt="Company logo"/></p>
<p><img src="/images/company_logo.png" alt="Company logo"/></p>
</div>
</div>
</footer>
12 changes: 12 additions & 0 deletions _includes/google_search.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div class="grid" id="searchBar">
<div>
<div id="search">
<!-- this didn't work locally for me: form role="search" method="get" action="{{ site.baseurl }}//search/" -->
<form role="search" method="get" action="/search">
<input id="searchString" name="searchString"
placeholder="Enter search term" type="text">
<input id="searchButton" name="googleSearchName" type="submit" value="Search">
</form>
</div>
</div>
</div>
18 changes: 9 additions & 9 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@
<meta name="description" content="{% if page.summary %}{{ page.summary | strip_html | strip_newlines | truncate: 160 }}{% endif %}">
<meta name="keywords" content="{{page.tags}}{% if page.tags %}, {% endif %} {{page.keywords}}">
<title>{{ page.title }} | {{ site.site_title }}</title>
<link rel="stylesheet" href="{{ "css/syntax.css" }}">
<link rel="stylesheet" href="/css/syntax.css">


<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<!--<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">-->
<link rel="stylesheet" href="{{ "css/modern-business.css" }}">
<link rel="stylesheet" href="{{ "css/lavish-bootstrap.css" }}">
<link rel="stylesheet" href="{{ "css/customstyles.css" }}">
<link rel="stylesheet" href="{{ "css/theme-blue.css" }}">
<link rel="stylesheet" href="/css/modern-business.css">
<link rel="stylesheet" href="/css/lavish-bootstrap.css">
<link rel="stylesheet" href="/css/customstyles.css">
<link rel="stylesheet" href="/css/theme-blue.css">

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
<script src="{{ "js/jquery.navgoco.min.js" }}"></script>
<script src="/js/jquery.navgoco.min.js"></script>


<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/2.0.0/anchor.min.js"></script>
<script src="{{ "js/toc.js" }}"></script>
<script src="{{ "js/customscripts.js" }}"></script>
<script src="/js/toc.js"></script>
<script src="/js/customscripts.js"></script>

<link rel="shortcut icon" href="{{ "images/favicon.ico" }}">
<link rel="shortcut icon" href="/images/favicon.ico">

<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
Expand Down
24 changes: 3 additions & 21 deletions _includes/topnav.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,27 +47,9 @@
{% if site.feedback_disable == null or site.feedback_disable == false %}
{% include feedback.html %}
{% endif %}
<!--comment out this block if you want to hide search-->
<li>
<!--start search-->
<div id="search-demo-container">
<input type="text" id="search-input" placeholder="{{site.data.strings.search_placeholder_text}}">
<ul id="results-container"></ul>
</div>
<script src="{{ "js/jekyll-search.js"}}" type="text/javascript"></script>
<script type="text/javascript">
SimpleJekyllSearch.init({
searchInput: document.getElementById('search-input'),
resultsContainer: document.getElementById('results-container'),
dataSource: '{{ "search.json" }}',
searchResultTemplate: '<li><a href="{url}" title="{{page.title | replace: "'", "\"}}">{title}</a></li>',
noResultsText: '{{site.data.strings.search_no_results_text}}',
limit: 10,
fuzzy: true,
})
</script>
<!--end search-->
</li>
<li>
{% include google_search.html %}
</li>
</ul>
</div>
</div>
Expand Down
1 change: 0 additions & 1 deletion _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
);
</script>
{% endif %}

</head>
<body>
{% include topnav.html %}
Expand Down
21 changes: 21 additions & 0 deletions search.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
layout: page
title: Search
permalink: /search/
sitemap: false
---
<div id="home-search" class="home">
<script>
(function() {
var cx = '008344980058477898326:akk3ovisc-i';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//www.google.com/cse/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<gcse:search queryParameterName="searchString"></gcse:search>
</div>

0 comments on commit 0967790

Please sign in to comment.