Replace hardcoded text with strings stored in _data file
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
---
|
||||
---
|
||||
|
||||
---
|
||||
var idx = lunr(function () {
|
||||
this.field('title', {boost: 10})
|
||||
this.field('excerpt')
|
||||
@@ -58,26 +58,26 @@ $(document).ready(function() {
|
||||
var query = $(this).val();
|
||||
var result = idx.search(query);
|
||||
resultdiv.empty();
|
||||
resultdiv.prepend('<p>'+result.length+' Result(s) found</p>');
|
||||
resultdiv.prepend('<p>'+result.length+' {{ site.data.ui-text[site.locale].results_found | default: "Result(s) found" }}</p>');
|
||||
for (var item in result) {
|
||||
var ref = result[item].ref;
|
||||
if(store[ref].teaser){
|
||||
var searchitem =
|
||||
'<div>'+
|
||||
'<div class="list__item">'+
|
||||
'<article class="archive__item" itemscope itemtype="http://schema.org/CreativeWork">'+
|
||||
'<div class="archive__item-teaser">'+
|
||||
'<img src="'+store[ref].teaser+'" alt="">'+
|
||||
'</div>'+
|
||||
'<h2 class="archive__item-title" itemprop="headline">'+
|
||||
'<a href="'+store[ref].url+'" rel="permalink">'+store[ref].title+'</a>'+
|
||||
'</h2>'+
|
||||
'<div class="archive__item-teaser">'+
|
||||
'<img src="'+store[ref].teaser+'" alt="">'+
|
||||
'</div>'+
|
||||
'<p class="archive__item-excerpt" itemprop="description">'+store[ref].excerpt+'</p>'+
|
||||
'</article>'+
|
||||
'</div>';
|
||||
}
|
||||
else{
|
||||
var searchitem =
|
||||
'<div>'+
|
||||
'<div class="list__item">'+
|
||||
'<article class="archive__item" itemscope itemtype="http://schema.org/CreativeWork">'+
|
||||
'<h2 class="archive__item-title" itemprop="headline">'+
|
||||
'<a href="'+store[ref].url+'" rel="permalink">'+store[ref].title+'</a>'+
|
||||
|
||||
Reference in New Issue
Block a user