diff --git a/src/autocomplete.js b/src/autocomplete.js index 138f9a08..d5b756c5 100644 --- a/src/autocomplete.js +++ b/src/autocomplete.js @@ -34,10 +34,11 @@ export default (options) => { } function header(text) { - return ` -
+ return ( + `
${text} -
`; +
` + ); } // initialize API client @@ -81,15 +82,17 @@ export default (options) => { hint: false, debug: true, templates: { - footer: `
- Search by - - Algolia - -
` + footer: ( + `
+ Search by + + Algolia + +
` + ) } }, sources).on('autocomplete:selected', (event, suggestion, dataset) => { if (dataset === 'sections' || dataset === 'articles') { diff --git a/src/templates.js b/src/templates.js index 2d3f7e1b..fc060b5a 100644 --- a/src/templates.js +++ b/src/templates.js @@ -3,8 +3,8 @@ import Hogan from 'hogan.js'; export default { autocomplete: { // Autocompletion template for a section - section: Hogan.compile(` -
+ section: Hogan.compile( + `
{{{ _highlightResult.category.title.value }}} > {{{ _highlightResult.title.value }}} @@ -15,8 +15,8 @@ export default {
`), // Autocompletion template for an article - article: Hogan.compile(` -
+ article: Hogan.compile( + `
{{{ _highlightResult.title.value }}} @@ -28,8 +28,8 @@ export default { instantsearch: { // Instant search result template - hit: Hogan.compile(` -
+ hit: Hogan.compile( + `