Skip to content
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
15 changes: 8 additions & 7 deletions _data/nav.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<nav class="nav-primary" role="navigation" >
<ul>
{% for p in site.pages %}
<li>
<a {% if p.url == page.url %}class="active"{% endif %} href="{{ site.baseurl }}{{ p.url }}">{{ p.title }}</a>
</li>
{% endfor %}
</ul>
{% include google-search.html %}
<ul>
{% for p in site.pages %}
<li>
<a {% if p.url == page.url %}class="active"{% endif %} href="{{ site.baseurl }}{{ p.url }}">{{ p.title }}</a>
</li>
{% endfor %}
</ul>
</nav>
12 changes: 12 additions & 0 deletions _includes/google-search.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<script>
(function() {
var cx = '002847422874721320632:rfhn5huo-js';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<gcse:search></gcse:search>
2 changes: 1 addition & 1 deletion _todo.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
TODO:
- Custom Domain
- Search Function
- Link to Github
- Introduction
Expand All @@ -16,3 +15,4 @@ DONE:
- Template
- Static Navigation
- Add Front Matter to All Pages
- Custom Domain
21 changes: 21 additions & 0 deletions search.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
layout: single
title: Search
permalink: /search/
sitemap: false
---
<div id="home-search" class="home">
<script>
(function() {
var cx = '[Your CSE Search ID]';
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>