INNER CODE UNIT · JavaScript
render
microsoft/azuredevopslabs · js/jekyll-search.js:202
function render(results) {
if (emptyResultsContainer(), 0 == results.length) return appendToResultsContainer(opt.noResultsText);
for (var i = 0; i < results.length; i++) appendToResultsContainer(templater.render(opt.searchResultTemplate, results[i]))
}
var self = this,
requiredOptions = ["searchInput", "resultsContainer", "dataSource"],
opt = {
searchInput: null,
resultsContainer: null,
dataSource: [],
searchResultTemplate: '<li><a href="{"url"}" title="{desc}">{title}</a></li>',
noResultsText: "No results found",
limit: 10,
fuzzy: !1
};
self.init = function(_opt) {
validateOptions(_opt), assignOptions(_opt), isJSON(opt.dataSource) ? initWithJSON(opt.dataSource) : initWithURL(opt.dataSource)
}