Open rempas opened 3 years ago
In my case, the reason why search doesn't work was missing /post/index.json
.
index.json
is like this and it's referred in search.js
.
index.json
, which contains metadata for all post of type post
, should be make automatically from layout list.json
(if you specified [outputs] section = ["json", "html"]
in config.toml
). But in my case, index.json
didn't contain any valid metadata because I wrote entries in content/posts
and my all entries has type posts
, not post
. After moving all entries from content/posts
to content/post
, search got to work fine.
The following article might help to find out how search feature works. https://janikvonrotz.ch/2019/06/10/2019-06-10-simple-hugo-page-search-with-lunrjs/
I don't know if I'm doing something wrong but search doesn't work for me. I got the page and I can type in the box but I get no results.