Search Layout

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.


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

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/ in the content directory.

2title = "Search"
3layout = "search"

Site Parameters

Name Type Default Description
search Object - Search configuration.
search.paginate Integer 10 Pagination.
search.resultContentWordCount Integer 240 The maximum word count of result content for displaying.
search.fuse Object - Fuse.js options .
search.fuse.ignoreLocation Boolean true
search.fuse.location Integer -
search.fuse.isCaseSensitive Boolean -
search.fuse.minMatchCharLength Integer -
search.fuse.threshold Double -
search.fuse.distance Integer -
search.fuse.useExtendedSearch Boolean -