README
hexo-tokenize-search
Dependence
Tokenize Dependence: Segment
Supports chinese and english tokenize .
Installation
$ npm install hexo-tokenize-search --save
Usage :
Config the search json
You can custom the json path in your global _config.xml
search:
path: search.json
When the plugin is installed , it will auto generator search.json (by default) in your root context.
The json is a array and each element will be included 5 field like this :
[
{
"title": "xxxxxx",
"url": "xxxxxx" ,
"content": "xxxxxx" ,
"title_tokenize": "xx xx xx xx",
"content_tokenize": "xx xx xx xx"
},
{
...
}
]
I removed html tags in the content field and remove punctuations in the tokenize field .
Use the search.json
You can use your query to custom sort the json array.
There is my simple example:
function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\\