Skip to content

Commit 6237504

Browse files
committed
Basic searching works
1 parent 91d85ee commit 6237504

File tree

13 files changed

+14
-19
lines changed

13 files changed

+14
-19
lines changed

_layouts/default.html

+9-4
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
</div>
4949
<div class="container">
5050
<div class="row">
51-
<div class="span9">
52-
{{content}}
51+
<div id="content" class="span9">
52+
{{content}}
5353
</div>
5454
<div class="span3">
5555
<div id="menu">
@@ -59,7 +59,7 @@
5959
<button id="searchbutton" type="submit" placeholder="Search" class="btn" onclick="doSearch();">Search</button>
6060
</div>
6161
</form>
62-
<ul class="nav nav-list" data-spy="affix">
62+
<ul class="nav nav-list">
6363
{% assign url = page.url|remove:'index.html' %}
6464
{% for heading in site.navigation %}
6565
<li class="nav-header">{{heading.heading}}</li>
@@ -81,9 +81,14 @@
8181
<script>
8282
function doSearch() {
8383
run_search(function doit() {
84+
var content;
85+
content = '<h1>Search Results<\/h1>\n';
86+
content += '<ul>\n';
8487
for (var i = 0, len = final_results.length; i < len; i++) {
85-
console.log(final_results[i].t + ' ' + final_results[i].u);
88+
content += '<li><a href="' + final_results[i].u + '">' + final_results[i].t + '<\/a><\/li>\n';
8689
}
90+
content += '<\/ul>';
91+
$('#content').html(content); //Replace main body of page with search results
8792
});
8893
}
8994
</script>

_plugins/gensearch.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def generate(site)
6767
# add the page info to the ferret index
6868
index << {
6969
:title => page.data['title'],
70-
:url => "#{page.dir}#{page.url}",
70+
:url => "#{page.url}",
7171
:content => page.content,
7272
}
7373

api/clients.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
layout: default
33
title: Smartmessages API Clients
4-
section: api/clients
54
---
65
#Smartmessages API Clients
76

api/index.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
layout: default
33
title: The Smartmessages API
4-
section: api
54
---
65
#The Smartmessages API
76

api/reference.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
layout: default
33
title: Smartmessages API Reference
4-
section: api/reference
54
---
65
# Smartmessages API Reference
76

index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
layout: default
3-
title: Welcome
3+
title: Smartmessages Docs Home
44
---
55

66
# Smartmessages Docs
77
## Welcome to the Smartmessages documentation!
88

9-
To get started, check out the links on the left.
9+
To get started, check out the links in the sidebar, or try a search.

tech/dkim.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
layout: default
3-
title: Smartmessages Technical Info
4-
section: tech/dkim
3+
title: Smartmessages Technical Info - DKIM
54
---
65
# DKIM - Domain Keys Identified Mail
76

tech/index.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
layout: default
33
title: Smartmessages Technical Info
4-
section: tech/
54
---
65
# Technical Overview
76

tech/spf.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
layout: default
3-
title: Smartmessages Technical Info
4-
section: tech/spf
3+
title: Smartmessages Technical Info - SPF
54
---
65
# SPF - The Sender Policy Framework
76

using/guides.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
layout: default
33
title: Smartmessages User Guides
4-
section: using/guides
54
---
65
#Smartmessages User Guides and Documents

using/index.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
layout: default
33
title: Getting Started with Smartmessages
4-
section: using/
54
---
65
# Getting Started With Smartmessages

using/tutorials.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
layout: default
33
title: Smartmessages Tutorials
4-
section: using/tutorials
54
---
65
# Smartmessages Tutorials

using/video.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
layout: default
33
title: Smartmessages Video Library
4-
section: using/video
54
---
65
# Smartmessages Video Library

0 commit comments

Comments
 (0)