@@ -137,6 +137,7 @@ function makeTeaser(body, terms) {
137137 var stemmedTerms = terms.map(function (w) {
138138 return elasticlunr.stemmer(w.toLowerCase());
139139 });
140+
140141 var termFound = false;
141142 var index = 0;
142143 var weighted = []; // contains elements of ["word", weight, index_in_document]
@@ -221,15 +222,15 @@ function makeTeaser(body, terms) {
221222 startIndex = word[2];
222223 }
223224
224− // add <em/> around search terms
225+ // add dark color around search terms
225226 if (word[1] === TERM_WEIGHT) {
226− teaser.push("<b>");
227+ teaser.push("<span class='gray70'>");
227228 }
228229 startIndex = word[2] + word[0].length;
229230 teaser.push(body.substring(word[2], startIndex));
230231
231232 if (word[1] === TERM_WEIGHT) {
232− teaser.push("</b>");
233+ teaser.push("</span>");
233234 }
234235 }
235236 teaser.push("…");
@@ -237,15 +238,35 @@ function makeTeaser(body, terms) {
237238}
238239
239240function 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);
251+*/
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);
256+ return fullTitle;
257+/*
240258 var pathArray = path.split( 'docs/' );
259+// console.log(pathArray);
241260 var slug = pathArray[1];
261+// console.log(slug);
242262 var slugArray = slug.split( '/' );
243263 var lastPartTitle = slugArray.splice(slugArray.length - 2, slugArray.length).join('');
244264 var firstPartTitle = slugArray.join(' / ');
245265
246− var fullTitle = firstPartTitle + ' / ' + '<span class="search-results__item__title__slug-end">' + lastPartTitle + '</span>';
266+ var fullTitle = firstPartTitle + '<span class="gray90">' + ' / ' + lastPartTitle + '</span>';
247267
248268 return fullTitle;
269+ */
249270}
250271
251272function formatSearchResultItem(item, terms) {
@@ -256,8 +277,9 @@ function formatSearchResultItem(item, terms) {
256277 li.classList.add("search-results__item");
257278 var hrefA = item.ref;
258279 createA.setAttribute('href', hrefA);
259− createA.innerHTML = `<span class="search-results__item__title">${teaserTitle}</span>`;
260− createA.innerHTML += `<div class="search-results__teaser">${makeTeaser(item.doc.body, terms)}</div>`;
280+ createA.setAttribute('class','no-underline block pl6 pv2');
281+ createA.innerHTML = `<span class="fs45 capitalize gray30">${teaserTitle}</span>`;
282+ createA.innerHTML += `<div class="fs35 gray30">${makeTeaser(item.doc.body, terms)}</div>`;
261283 return li;
262284}
263285