It may be difficult for readers to retrieve an article in the case if there are many articles in your site, therefore, we added the search feature.

Prerequisites

First of all, we need to append JSON to the home outputs in the configuration file.

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

This step generates an index file index.json, in order to retrieve content by JavaScript.

Secondary, create a page called search/_index.md in the content directory.

1+++
2title = "Search"
3layout = "search"
4+++

Site Parameters

NameTypeDefaultDescription
searchObject-Search configuration.
search.paginateInteger10Pagination.
search.resultContentWordCountInteger240The maximum word count of result content for displaying.
search.fuseObject-Fuse.js options .
search.fuse.ignoreLocationBooleantrue
search.fuse.locationInteger-
search.fuse.isCaseSensitiveBoolean-
search.fuse.minMatchCharLengthInteger-
search.fuse.thresholdDouble-
search.fuse.distanceInteger-
search.fuse.useExtendedSearchBoolean-