File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ title: Search Tutorials
1414<!-- Configuration -->
1515<script >
1616var tutorials = { {% for topic in site .data % }
17- {% if topic[0 ] == ' use' or topic[0 ] == ' admin-dev' or topic[0 ] == ' basics' % }
17+ {% if topic[1 ]. type == ' use' or topic[1 ]. type == ' admin-dev' or topic[1 ]. type == ' basics' % }
1818 {% assign topic_material = site .pages | topic_filter: topic[0 ] % }
1919 {% assign topic_title = topic[1 ].title % }
2020 {% for tutorial in topic_material % }
@@ -62,11 +62,13 @@ var tutorials = { {% for topic in site.data %}
6262
6363
6464function search (idx , q ){
65- var results = idx .search (` *${ q} *` ).map (x => {
66- return tutorials[' /' + x .ref .replaceAll (" .md" , " .html" )];
67- }).filter (x => x !== undefined );
65+ if (q .length > 2 ){
66+ var results = idx .search (` *${ q} *` ).map (x => {
67+ return tutorials[' /' + x .ref .replaceAll (" .md" , " .html" )];
68+ }).filter (x => x !== undefined );
6869
69- $ (" #results-container" ).html (results .map (x => x .entry ));
70+ $ (" #results-container" ).html (results .map (x => x .entry ));
71+ }
7072}
7173
7274fetch (' {{ site.baseurl }}/search.json' )
You can’t perform that action at this time.
0 commit comments