@@ -137,6 +137,7 @@ function makeTeaser(body, terms) {
137 var stemmedTerms = terms.map(function (w) {
137 var stemmedTerms = terms.map(function (w) {
138 return elasticlunr.stemmer(w.toLowerCase());
138 return elasticlunr.stemmer(w.toLowerCase());
140 var termFound = false;
141 var termFound = false;
141 var index = 0;
142 var index = 0;
142 var weighted = []; // contains elements of ["word", weight, index_in_document]
143 var weighted = []; // contains elements of ["word", weight, index_in_document]
@@ -221,15 +222,15 @@ function makeTeaser(body, terms) {
221 startIndex = word[2];
222 startIndex = word[2];
224− // add <em/> around search terms
225+ // add dark color around search terms
225 if (word[1] === TERM_WEIGHT) {
226 if (word[1] === TERM_WEIGHT) {
226− teaser.push("<b>");
227+ teaser.push("<span class='gray70'>");
228 startIndex = word[2] + word[0].length;
229 startIndex = word[2] + word[0].length;
229 teaser.push(body.substring(word[2], startIndex));
230 teaser.push(body.substring(word[2], startIndex));
231 if (word[1] === TERM_WEIGHT) {
232 if (word[1] === TERM_WEIGHT) {
232− teaser.push("</b>");
233+ teaser.push("</span>");
235 teaser.push("…");
236 teaser.push("…");
@@ -237,15 +238,35 @@ function makeTeaser(body, terms) {
239function formatSearchResultTitle(path) {
240function formatSearchResultTitle(path) {
241+// console.log(path);
242+ var pathArray = path.split( '/' );
243+ //console.log(pathArray);
244+ /*var slug = pathArray[1];
245+// console.log(slug);
246+ var slugArray = slug.split( '/' );
247+ var lastPartTitle = slugArray.splice(slugArray.length - 2, slugArray.length).join('');
248+ var firstPartTitle = slugArray.join(' / ');
249+//console.log(lastPartTitle);
250+//console.log(firstPartTitle);
252+ var firstPartTitle = pathArray[3]; // first directory is in 4th element of path array
253+ var lastPartTitle = pathArray[pathArray.length-2]; // last directory is in 2nd to last element of array
254+ var fullTitle = firstPartTitle + '<span class="gray90">' + ' / ' + lastPartTitle + '</span>';
255+ console.log(fullTitle);
240 var pathArray = path.split( 'docs/' );
258 var pathArray = path.split( 'docs/' );
259+// console.log(pathArray);
241 var slug = pathArray[1];
260 var slug = pathArray[1];
261+// console.log(slug);
242 var slugArray = slug.split( '/' );
262 var slugArray = slug.split( '/' );
243 var lastPartTitle = slugArray.splice(slugArray.length - 2, slugArray.length).join('');
263 var lastPartTitle = slugArray.splice(slugArray.length - 2, slugArray.length).join('');
244 var firstPartTitle = slugArray.join(' / ');
264 var firstPartTitle = slugArray.join(' / ');
246− var fullTitle = firstPartTitle + ' / ' + '<span class="search-results__item__title__slug-end">' + lastPartTitle + '</span>';
266+ var fullTitle = firstPartTitle + '<span class="gray90">' + ' / ' + lastPartTitle + '</span>';
248 return fullTitle;
268 return fullTitle;
251function formatSearchResultItem(item, terms) {
272function formatSearchResultItem(item, terms) {
@@ -256,8 +277,9 @@ function formatSearchResultItem(item, terms) {
256 li.classList.add("search-results__item");
277 li.classList.add("search-results__item");
257 var hrefA = item.ref;
278 var hrefA = item.ref;
258 createA.setAttribute('href', hrefA);
279 createA.setAttribute('href', hrefA);
280+ createA.setAttribute('class','no-underline block pl6 pv2');
259− createA.innerHTML = `<span class="search-results__item__title">${teaserTitle}</span>`;
281+ createA.innerHTML = `<span class="fs45 capitalize gray30">${teaserTitle}</span>`;
260− createA.innerHTML += `<div class="search-results__teaser">${makeTeaser(item.doc.body, terms)}</div>`;
282+ createA.innerHTML += `<div class="fs35 gray30">${makeTeaser(item.doc.body, terms)}</div>`;
261 return li;
283 return li;