kaushalmodi / hugo-search-fuse-js

Hugo theme component for implementing static site search using Fuse.js
https://hugo-search-fuse-js.netlify.app/
GNU General Public License v3.0
68 stars 23 forks source link

Search seems to be not working with terminal theme #2

Closed mohanboddu closed 5 years ago

mohanboddu commented 5 years ago

I am using terminal theme which seems to have met all the requirements and I followed the doc.

  1. Downloaded the repo and added it to themes/hugo-search-fuse-js directory
  2. Added the theme name first in config.toml
    theme = ["hugo-search-fuse-js", "terminal"]
  3. Added the search.md file under content/ directory
    +++
    title = "Search"
    layout = "search"
    outputs = ["html", "json"]
    [sitemap]
    priority = 0.1
    +++

But it seems to be not working.

Initially I got an warning with json in the outputs list:

WARN 2019/03/18 22:24:25 Found no layout for "page", language "en", output format "JSON": create a template below /layouts with one of these filenames: search.en.json.json, single.en.json.json, search.json.json, single.json.json, search.en.json, single.en.json, search.json, single.json, _default/search.en.json.json, _default/single.en.json.json, _default/search.json.json, _default/single.json.json, _default/search.en.json, _default/single.en.json, _default/search.json, _default/single.json

When I removed json from outputs list I am not seeing it anymore.

When I go to localhost:1313/search/ I can see a search post but the query localhost:1313/search/?q=test is not working either.

Do I need to do anything after step 3 and before running the hugo server or am I missing something.

kaushalmodi commented 5 years ago

When I removed json from outputs list I am not seeing it anymore.

You would certainly not want to do that. The "json" output format is what exactly the search index.

Can you share your repo so that I can reproduce that same warning locally and debug?

mohanboddu commented 5 years ago

Thanks for the input, I made a mistake on my end.

I am using hugo server -t terminal instead of --themesDir.

The issue has been fixed.

Thanks for quick response.