mirror of
https://github.com/idanoo/m2.nz
synced 2025-07-05 06:12:15 +00:00
Add theme
This commit is contained in:
parent
e11c3f7f7d
commit
7589ad1190
2580 changed files with 52545 additions and 4 deletions
8
themes/LoveIt/src/lib/lunr/lunr.segmentit.js
Normal file
8
themes/LoveIt/src/lib/lunr/lunr.segmentit.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
import { Segment, useDefault } from 'segmentit';
|
||||
|
||||
const segmentit = useDefault(new Segment());
|
||||
lunr.segmentit = segmentit;
|
||||
lunr.queryHandler = query => {
|
||||
if (/^[\u4e00-\u9fa5]+$/.test(query)) query = lunr.segmentit.doSegment(query).map(seg => '+' + seg.w).join(' ');
|
||||
return query;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue