@@ -106,7 +106,6 @@ function debounce(func, wait) {
106// maximum sum. If there are multiple maximas, then get the last one.
106// maximum sum. If there are multiple maximas, then get the last one.
107// Enclose the terms in <b>.
107// Enclose the terms in <b>.
108function makeTeaser(body, terms) {
108function makeTeaser(body, terms) {
109− console.log("make teaser");
110 var TERM_WEIGHT = 40;
109 var TERM_WEIGHT = 40;
111 var NORMAL_WORD_WEIGHT = 2;
110 var NORMAL_WORD_WEIGHT = 2;
112 var FIRST_WORD_WEIGHT = 8;
111 var FIRST_WORD_WEIGHT = 8;
@@ -225,7 +224,7 @@ function formatSearchResultTitle(path) {
225 // last directory is in 2nd to last element of array
224 // last directory is in 2nd to last element of array
226 var lastPartTitle = pathArray[pathArray.length-2].replace(/-/g,' ');
225 var lastPartTitle = pathArray[pathArray.length-2].replace(/-/g,' ');
228− var fullTitle = firstPartTitle + '<span class="gray90">' + ' / ' + lastPartTitle + '</span>';
227+ var fullTitle = firstPartTitle + '<span class="gray90 inline-block pl2">' + ' / ' + lastPartTitle + '</span>';
230 return fullTitle;
229 return fullTitle;
@@ -236,18 +235,18 @@ function formatSearchResultItem(item, terms) {
236 li.appendChild(createA);
235 li.appendChild(createA);
237 var teaserTitle = formatSearchResultTitle(item.ref);
236 var teaserTitle = formatSearchResultTitle(item.ref);
238 li.classList.add("search-results__item");
237 li.classList.add("search-results__item");
238+ li.classList.add("ph3");
239 var hrefA = item.ref;
239 var hrefA = item.ref;
240 createA.setAttribute('href', hrefA);
240 createA.setAttribute('href', hrefA);
241− createA.setAttribute('class','no-underline block pl6 pv2');
241+ createA.setAttribute('class','no-underline block pl6 pv3');
242 createA.innerHTML = `<span class="fs45 capitalize gray30">${teaserTitle}</span>`;
242 createA.innerHTML = `<span class="fs45 capitalize gray30">${teaserTitle}</span>`;
243+ createA.innerHTML += `<span class='pr7 fs5 none float-right'>→</span>`;
243− createA.innerHTML += `<div class="fs35 gray30">${makeTeaser(item.doc.body, terms)}</div>`;
244+ createA.innerHTML += `<div class="fs35 gray30 truncate mr10">${makeTeaser(item.doc.body, terms)}</div>`;
244 return li;
245 return li;
247function initSearch() {
248function initSearch() {
248− console.log("init search");
249 var searchInput = document.getElementById("search");
249 var searchInput = document.getElementById("search");
251 if (!searchInput) {
250 if (!searchInput) {
@@ -256,7 +255,6 @@ function initSearch() {
256 var searchResultsHeader = document.querySelector(".search-results__header");
255 var searchResultsHeader = document.querySelector(".search-results__header");
257 var searchResultsItems = document.querySelector(".search-results__items");
256 var searchResultsItems = document.querySelector(".search-results__items");
258 var MAX_ITEMS = 200;
257 var MAX_ITEMS = 200;
260 var options = {
258 var options = {
261 bool: "AND",
259 bool: "AND",
262 expand: true, // turn on partial word search
260 expand: true, // turn on partial word search
@@ -267,7 +265,6 @@ function initSearch() {
268 var currentTerm = "";
266 var currentTerm = "";
269 var index = elasticlunr.Index.load(window.searchIndex);
267 var index = elasticlunr.Index.load(window.searchIndex);
271 // toggle search window
268 // toggle search window
272 var toggleSearchWindow = document.getElementById('js-search-window-toggle');
269 var toggleSearchWindow = document.getElementById('js-search-window-toggle');
273 var bodyEl = document.body;
270 var bodyEl = document.body;
@@ -290,11 +287,9 @@ function initSearch() {
294 // when typing
290 // when typing
295 searchInput.addEventListener("keyup", debounce(function() {
291 searchInput.addEventListener("keyup", debounce(function() {
296 searchResultsHeader.value = "";
292 searchResultsHeader.value = "";
298 var term = searchInput.value.trim();
293 var term = searchInput.value.trim();