hugo-toha/content/search/search.jp.md
Andreas Deininger 3edd8e7858
Fix deprecation warnings (#908)
* Example site: bump hugo modules to latest versions

* Fix deprecation warnings emitted by hugo v0.124

* Fix typos

* Netlify: bump hugo version

---------

Co-authored-by: Emruz Hossain <hossainemruz@gmail.com>
2024-05-11 00:00:29 +06:00

1.1 KiB

title date weight sitemap layout url
Search Results 2010-06-08T08:06:25+06:00 999999
priority
0.1
search search

This file exists solely to respond to /search URL with the related search layout template.

No content shown here is rendered, all content is based in the template layouts/page/search.html

Setting a very low sitemap priority will tell search engines this is not important content.

This implementation uses Fusejs and mark.js

Initial setup

Search depends on additional output content type of JSON in config.toml ``` [outputs] home = ["HTML", "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}}, "categories" : {{ .Params.categories | jsonify }}, ... ```

assets/scripts/pages/search.js ``` keys: [ "title", "contents", "tags", "categories" ] ```