From 65ea9103ee43a9678edc7ada1800f5f6cdcc2b15 Mon Sep 17 00:00:00 2001 From: Ash Furrow Date: Sat, 25 Mar 2017 19:36:12 -0400 Subject: [PATCH] Initial work on lunrjs search. --- Gemfile | 1 + Gemfile.lock | 21 +++++++++++- _config.yml | 4 +++ _includes/head.html | 1 + _includes/search.html | 3 +- _layouts/search.html | 43 ++++++++++++++---------- _sass/screen.scss | 72 ++-------------------------------------- blog/archives/index.html | 1 + feed.xml | 1 + open-source/index.html | 1 + 10 files changed, 58 insertions(+), 90 deletions(-) diff --git a/Gemfile b/Gemfile index 443a29f52c..a9abc99925 100644 --- a/Gemfile +++ b/Gemfile @@ -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' diff --git a/Gemfile.lock b/Gemfile.lock index 09138d114b..08bed3f034 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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,6 +97,7 @@ 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) @@ -94,9 +105,12 @@ GEM 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,6 +161,7 @@ DEPENDENCIES danger danger-prose! jekyll + jekyll-lunr-js-search! octopress-hooks pry pygments.rb @@ -150,4 +169,4 @@ DEPENDENCIES rdiscount BUNDLED WITH - 1.13.6 + 1.14.3 diff --git a/_config.yml b/_config.yml index 60e4d2c7ee..b346efc406 100644 --- a/_config.yml +++ b/_config.yml @@ -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 diff --git a/_includes/head.html b/_includes/head.html index 5820c86844..e969a8c68e 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -30,6 +30,7 @@ + {% if page.opensource == true %} diff --git a/_includes/search.html b/_includes/search.html index dc212d0d13..a80625462f 100644 --- a/_includes/search.html +++ b/_includes/search.html @@ -1,6 +1,5 @@ {% if site.google_custom_search %}
- - +
{% endif %} diff --git a/_layouts/search.html b/_layouts/search.html index 153d1116cd..720d3cb074 100644 --- a/_layouts/search.html +++ b/_layouts/search.html @@ -1,23 +1,32 @@ --- layout: default +exclude_from_search: true ---
- - -
-
-
-
+
+
+ + + + +{% raw %} + +{% endraw %} diff --git a/_sass/screen.scss b/_sass/screen.scss index c86d510c51..bde0b37ce2 100644 --- a/_sass/screen.scss +++ b/_sass/screen.scss @@ -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; } } diff --git a/blog/archives/index.html b/blog/archives/index.html index d0d7b18636..54d56e57d5 100644 --- a/blog/archives/index.html +++ b/blog/archives/index.html @@ -2,6 +2,7 @@ layout: page title: Blog Archive footer: false +exclude_from_search: true ---
diff --git a/feed.xml b/feed.xml index a6628bd842..b4fcd0482e 100644 --- a/feed.xml +++ b/feed.xml @@ -1,5 +1,6 @@ --- layout: null +exclude_from_search: true --- diff --git a/open-source/index.html b/open-source/index.html index aa5c2b7a95..071cd14fc5 100644 --- a/open-source/index.html +++ b/open-source/index.html @@ -6,6 +6,7 @@ comments: false sharing: true footer: true +exclude_from_search: true ---