Skip to content
Permalink
Browse files

Initial work on lunrjs search.

  • Loading branch information...
ashfurrow committed Mar 25, 2017
1 parent 8f08e38 commit 65ea9103ee43a9678edc7ada1800f5f6cdcc2b15
Showing with 58 additions and 90 deletions.
  1. +1 −0 Gemfile
  2. +20 −1 Gemfile.lock
  3. +4 −0 _config.yml
  4. +1 −0 _includes/head.html
  5. +1 −2 _includes/search.html
  6. +26 −17 _layouts/search.html
  7. +2 −70 _sass/screen.scss
  8. +1 −0 blog/archives/index.html
  9. +1 −0 feed.xml
  10. +1 −0 open-source/index.html
@@ -8,6 +8,7 @@ gem 'rdiscount'
gem 'pygments.rb'
gem 'RedCloth'
gem 'pry'
gem 'jekyll-lunr-js-search', git: 'https://github.com/ashfurrow/jekyll-lunr-js-search.git', branch: 'v2'

group :distribution do
gem 'danger'
@@ -1,3 +1,13 @@
GIT
remote: https://github.com/ashfurrow/jekyll-lunr-js-search.git
revision: f39837bf2fc7a1b2ac408b2d1386acefbb65c219
branch: v2
specs:
jekyll-lunr-js-search (3.0.0)
nokogiri (~> 1.6)
therubyracer (~> 0.12)
yajl-ruby

GIT
remote: https://github.com/dbgrandi/danger-prose
revision: 53603ff7d13691c0c7772e13474a6c10958fcfa5
@@ -87,16 +97,20 @@ GEM
jekyll-watch (1.2.1)
listen (~> 2.7)
kramdown (1.13.1)
libv8 (3.16.14.19)
liquid (2.6.3)
listen (2.10.1)
celluloid (~> 0.16.0)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
mercenary (0.3.5)
method_source (0.8.2)
mini_portile2 (2.1.0)
multi_json (1.11.2)
multipart-post (2.0.0)
nap (1.1.0)
nokogiri (1.7.1)
mini_portile2 (~> 2.1.0)
octokit (4.6.2)
sawyer (~> 0.8.0, >= 0.5.3)
octopress-hooks (2.6.1)
@@ -119,6 +133,7 @@ GEM
ffi (>= 0.5.0)
rdiscount (2.1.7)
redcarpet (3.3.4)
ref (2.0.0)
safe_yaml (1.0.4)
sass (3.4.16)
sawyer (0.8.1)
@@ -127,6 +142,9 @@ GEM
slop (3.6.0)
terminal-table (1.7.3)
unicode-display_width (~> 1.1.1)
therubyracer (0.12.3)
libv8 (~> 3.16.14.15)
ref
timers (4.0.1)
hitimes
toml (0.1.2)
@@ -143,11 +161,12 @@ DEPENDENCIES
danger
danger-prose!
jekyll
jekyll-lunr-js-search!
octopress-hooks
pry
pygments.rb
rake
rdiscount

BUNDLED WITH
1.13.6
1.14.3
@@ -13,6 +13,10 @@ disqus_show_comment_count: false

exclude: [vendor]

gems: ['jekyll-lunr-js-search']
lunr_search:
js_dir: "javascripts"

markdown: rdiscount
highlighter: pygments

@@ -30,6 +30,7 @@
<script src="{{ root_url }}/javascripts/gradient-fade.js"></script>
<script src="{{ root_url }}/javascripts/noframework.waypoints.min.js"></script>
<script src="{{ root_url }}/javascripts/sticky.min.js"></script>
<script src="{{ root_url }}/javascripts/search.min.js"></script>

{% if page.opensource == true %}
<script src="{{ root_url }}/javascripts/modernizr-2.0.js"></script>
@@ -1,6 +1,5 @@
{% if site.google_custom_search %}
<form action="/search" method="get">
<input type="hidden" value="{{ site.google_custom_search }}" name="cx"/>
<input class="search" type="text" name="q" results="0" placeholder="Search"/>
<input class="search" id="search-query" type="text" name="q" results="0" placeholder="Search"/>
</form>
{% endif %}
@@ -1,23 +1,32 @@
---
layout: default
exclude_from_search: true
---

<div id="search-container">
<script>
(function() {
var cx = '010245880960712892902:tnjd4ryb3ci';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<gcse:searchresults-only>
<div class="spinner-wrapper">
<div class="spinner"></div>
</div>
</gcse:searchresults-only>
<div class="entries">
</div>
</div>

<script type="text/javascript">
$(function() {
$('#search-query').focus().lunrSearch({
indexUrl : '/javascripts/index.json', // url for the .json file containing search index data
results : '#search-container', // selector for containing search results element
template : '#search-results-template', // selector for Mustache.js template
});
});
</script>


{% raw %}
<script id="search-results-template" type="text/mustache">
<ul>
{{#entries}}
<li>
<a href="{{url}}">{{title}}</a> – {{#date}}<small><time datetime="{{pubdate}}" pubdate>{{displaydate}}</time></small>{{/date}}
</li>
{{/entries}}
</ul>
</script>
{% endraw %}
@@ -947,76 +947,8 @@ figure.code {
margin-left: 250px;
text-decoration: none;

.gsc-above-wrapper-area {
border-bottom: 1px solid $artsy-text;
margin-bottom: 40px;
}
.gsc-result-info-container, .gsc-orderby-container {
color: $artsy-text;
padding: 0;
padding-bottom: 20px;
margin-bottom: 20px;
}
.gsc-orderby-container {
display: none;
}
.gsc-result-info, .gsc-orderby-label {
color: $artsy-text;
}
.gsc-webResult {
padding: 0;
padding-bottom: 40px;
margin-bottom: 40px;
border-style: none;
}
.gsc-result-info {
padding: 0;
font-size: 20px;
}
.gs-snippet{
background-color: rgba(0,0,0,0);
font-family: $serif;
border-style: none;
font-size: 20px;
padding: 0;
margin: 0;
b {
color: black;
text-decoration: underline;;
}
}
.gsc-result{
background-color: rgba(0,0,0,0);
text-decoration: none;
border-bottom: 1px solid $artsy-text;
}
.gsc-control-cse{
padding: 0;
background-color: rgba(0,0,0,0);
border-style: none;
font-family: $serif;
font-size: 20px;
}
.gs-title{
font-family: $serif;
font-weight: 600;
font-size: 20px;
text-decoration: none;
b {
font-family: $serif;
text-decoration: none;
font-size: 20px;
}
}
.gsc-thumbnail-inside, .gsc-url-top, .gsc-table-result, .gsc-cursor-box{
padding: 0;
}
.gs-visibleUrl {
display: none;
}
.gs-snippet b:first-of-type {
display: block;
opacity: 0;
a {
font-weight: bold;
}
}

@@ -2,6 +2,7 @@
layout: page
title: Blog Archive
footer: false
exclude_from_search: true
---

<div id="blog-archives">
@@ -1,5 +1,6 @@
---
layout: null
exclude_from_search: true
---
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
@@ -6,6 +6,7 @@
comments: false
sharing: true
footer: true
exclude_from_search: true
---
<div id="page-sidebar">
<ul>

0 comments on commit 65ea910

Please sign in to comment.
You can’t perform that action at this time.