Add the search page
This commit is contained in:
parent
ac474ceccc
commit
db577a69ea
|
@ -0,0 +1,6 @@
|
|||
build:
|
||||
hugo -D
|
||||
npm run index
|
||||
clean:
|
||||
rm -rf public
|
||||
rm -v $(shell find . -iname "*~")
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
title: "Search"
|
||||
layout: "search"
|
||||
---
|
|
@ -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"
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue