Search

prerequisite

Make sure you set the right baseURL in the config.toml file. Search working fine when you run your site locally even though you haven’t set the baseURL. But it will make trouble when you deploy it to the server. See the issue regarding this.

params.toml

There are few parameters related to the search.

1
2
3
4
enableSearch = true
enableSearchHighlight = true
enableAppbarSearchIcon = true
searchResultPosition = "main" # side, main

Check out the params.toml document for mor information

config.toml

Zzo theme make search index for the search. So, in order to use the search, you need to add this config params to config.toml file.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
...
[outputs]
  home = ["HTML", "RSS", "SearchIndex"]
  section = ["HTML", "RSS", "SearchIndex"]
  taxonomyTerm = ["HTML", "RSS", "SearchIndex"]
  taxonomy = ["HTML", "RSS", "SearchIndex"]

[outputFormats]
  [outputFormats.SearchIndex]
    mediaType = "application/json"
    baseName = "index"
    isPlainText = true
    notAlternative = true

These config params make search index on home, section, taxonomy page.