summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorAdam Carpenter <53hornet@gmail.com>2019-05-24 18:05:52 -0400
committerAdam Carpenter <53hornet@gmail.com>2019-05-24 18:05:52 -0400
commitc7e3a802639ba8bfadbf92a8795b7f80277cf6eb (patch)
tree6b54c2be4704477a29d810b67e1ac16a81f94dbe /public
parenta9eef56423c90bd335f79b13e7a4ac67d82db303 (diff)
downloadcobalt-site-c7e3a802639ba8bfadbf92a8795b7f80277cf6eb.tar.xz
cobalt-site-c7e3a802639ba8bfadbf92a8795b7f80277cf6eb.zip
Merge
Diffstat (limited to 'public')
-rw-r--r--public/js/posts.lunr.js23
1 files changed, 23 insertions, 0 deletions
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");
+}