Navigation Menu

Skip to content

Commit

Permalink
Link paths to the corresponding query
Browse files Browse the repository at this point in the history
  • Loading branch information
darashi committed Aug 15, 2012
1 parent 69f7960 commit ac15925
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/server.js
@@ -1,5 +1,6 @@
var http = require('http');
var express = require('express');
var querystring = require('querystring');
var app = express();
var env = process.env;
var port = env.PORT ? parseInt(env.PORT, 10) : 3000;
Expand Down Expand Up @@ -69,6 +70,7 @@ app.get('/search', function(request, response, next) {
return next(error);
}
var locals = {
querystring: querystring,
query: query,
records: results.hits.hit,
num_found: results.hits.found,
Expand Down
5 changes: 3 additions & 2 deletions views/search.jade
Expand Up @@ -18,8 +18,9 @@ block content
h2 #{record.data.title}
p.path
each title, pathIndex in record.data.path
span.label.label-inverse
= title
span
a(href="/search?"+querystring.stringify({query: title}))
= title
if pathIndex != record.data.path.length - 1
span »

Expand Down

0 comments on commit ac15925

Please sign in to comment.