mirror of
https://github.com/Brandon-Rozek/website-theme.git
synced 2024-11-09 10:50:34 -05:00
Bug fix
This commit is contained in:
parent
d3d0669c0d
commit
a821794a91
1 changed files with 2 additions and 2 deletions
|
@ -66,7 +66,7 @@ function initUI () {
|
||||||
function renderResults (results) {
|
function renderResults (results) {
|
||||||
var $searchResults = $('#searchResults')
|
var $searchResults = $('#searchResults')
|
||||||
var query = $('#searchBox').val()
|
var query = $('#searchBox').val()
|
||||||
var SUMMARY_INCLUDE = 100
|
var SUMMARY_INCLUDE = 50
|
||||||
var MAX_PAGES = 10
|
var MAX_PAGES = 10
|
||||||
|
|
||||||
// Clear search result
|
// Clear search result
|
||||||
|
@ -84,7 +84,7 @@ function renderResults (results) {
|
||||||
var matchPosition = result.body.indexOf(query.split(' ')[0])
|
var matchPosition = result.body.indexOf(query.split(' ')[0])
|
||||||
var bodyStartPosition = matchPosition - SUMMARY_INCLUDE > 0 ? matchPosition - SUMMARY_INCLUDE : 0
|
var bodyStartPosition = matchPosition - SUMMARY_INCLUDE > 0 ? matchPosition - SUMMARY_INCLUDE : 0
|
||||||
$searchResultPage.append('<a class="searchResultTitle" href="' + result.ref + '">' + result.title + '</a>')
|
$searchResultPage.append('<a class="searchResultTitle" href="' + result.ref + '">' + result.title + '</a>')
|
||||||
$searchResultPage.append('<div class="searchResultBody">' + result.body.substr(bodyStartPosition, SUMMARY_INCLUDE) + '</div>')
|
$searchResultPage.append('<div class="searchResultBody">' + result.body.substr(bodyStartPosition, SUMMARY_INCLUDE * 2) + '</div>')
|
||||||
$searchResults.append($searchResultPage)
|
$searchResults.append($searchResultPage)
|
||||||
|
|
||||||
// Highlight keyword
|
// Highlight keyword
|
||||||
|
|
Loading…
Reference in a new issue