ASCII smiley face (site logo) Wild Tech "Garden"
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode

Search Setup

Search Setup

This implementation uses Fusejs, and mark.js (without jQuery)

Initial setup

Search depends on additional output content type of JSON in config.toml

[outputs]
  home = ["HTML", "RSS", "JSON"]

Searching additional fields

To search additional fields defined in front matter, you must add it in 2 places.

Edit layouts/_default/index.json

This exposes the values in /index.json i.e. add category

...
  "contents":{{ .Content | plainify | jsonify }}
  {{ if .Params.tags }},
  "tags":{{ .Params.tags | jsonify }}{{end}}
  {{ if .Params.categories }},
  "categories" : {{ .Params.categories | jsonify }}{{ end }}
...

static/js/search.js

keys: [
  "title",
  "contents",
  "tags",
  "categories"
]