diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4ead78a --- /dev/null +++ b/Makefile @@ -0,0 +1,6 @@ +build: + hugo -D + npm run index +clean: + rm -rf public + rm -v $(shell find . -iname "*~") diff --git a/content/search.md b/content/search.md new file mode 100644 index 0000000..9da8567 --- /dev/null +++ b/content/search.md @@ -0,0 +1,4 @@ +--- +title: "Search" +layout: "search" +--- diff --git a/package.json b/package.json index d95a865..9ee8308 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "scripts": { - "index": "hugo-lunr" + "index": "mkdir -p public/db && hugo-lunr -i 'content/**' -o public/db/db.json" }, "dependencies": { "hugo-lunr": "^0.0.4" diff --git a/themes/coyote/assets/js/search.js b/themes/coyote/assets/js/search.js index 3f21eb3..d332565 100644 --- a/themes/coyote/assets/js/search.js +++ b/themes/coyote/assets/js/search.js @@ -1,4 +1,4 @@ -et fuse +let fuse const fuseOptions = { shouldSort: true, includeMatches: true, @@ -17,8 +17,7 @@ const fuseOptions = { } window.onload = function () { - console.log("dvfdj") - fetch('/index.json') + fetch('/db/db.json') .then(resp => resp.json()) .then(data => { fuse = new Fuse(data, fuseOptions)