From c7e3a802639ba8bfadbf92a8795b7f80277cf6eb Mon Sep 17 00:00:00 2001 From: Adam Carpenter <53hornet@gmail.com> Date: Fri, 24 May 2019 18:05:52 -0400 Subject: Merge --- _layouts/journal.liquid | 18 ---------- _layouts/search.liquid | 92 +++++++++++++++++++++++++++++++++++++++++++++++++ pages/search.md | 6 ++++ public/js/posts.lunr.js | 23 +++++++++++++ 4 files changed, 121 insertions(+), 18 deletions(-) create mode 100644 _layouts/search.liquid create mode 100644 pages/search.md create mode 100644 public/js/posts.lunr.js diff --git a/_layouts/journal.liquid b/_layouts/journal.liquid index 6251483..e3f5ae4 100644 --- a/_layouts/journal.liquid +++ b/_layouts/journal.liquid @@ -30,24 +30,6 @@ - -
-
-
-
-
- -
-
- -
-
-
- -
diff --git a/_layouts/search.liquid b/_layouts/search.liquid new file mode 100644 index 0000000..e1d2434 --- /dev/null +++ b/_layouts/search.liquid @@ -0,0 +1,92 @@ + + + + {% include "head.liquid" %} + + + + + + +
+ +
+ {% include "nav.liquid" %} +
+ + + +
+
+

+ {{ page.title }} +

+
+
+ + +
+ + + +
+
+
+
+ +
+
+ + +
+
+ + + +
+
+ +
+ {{ page.content }} +
+ +
+
+ + + +
+
+
+ + +
+ {% include all-posts.liquid %} +
+ + + +
+ {% include post-list.liquid %} +
+ + +
+
+
+ + + + + + diff --git a/pages/search.md b/pages/search.md new file mode 100644 index 0000000..09b576e --- /dev/null +++ b/pages/search.md @@ -0,0 +1,6 @@ +--- +title: Site Search +layout: search.liquid +permalink: "/{{slug}}" +--- +# Search the entire site diff --git a/public/js/posts.lunr.js b/public/js/posts.lunr.js new file mode 100644 index 0000000..bea1216 --- /dev/null +++ b/public/js/posts.lunr.js @@ -0,0 +1,23 @@ +let documents = [{ + "name": "Lunr", + "text": "Like Solr, but much smaller, and not as bright." +}, { + "name": "React", + "text": "A JavaScript library for building user interfaces." +}, { + "name": "Lodash", + "text": "A modern JavaScript utility library delivering modularity, performance & extras." +}]; + +function search() { + let searchIndex = lunr(function() { + this.ref("name") + this.field("text") + + documents.forEach(function(doc) { + this.add(doc) + }, this) + }); + + return searchIndex.search("bright"); +} -- cgit v1.2.3