mirror of
https://github.com/Decentralized-ID/decentralized-id.github.io.git
synced 2025-09-19 04:04:44 -04:00
upgrade theme
This commit is contained in:
parent
b14c47352e
commit
d68502a8d9
58 changed files with 640 additions and 646 deletions
|
@ -19,8 +19,9 @@ const search = instantsearch({
|
|||
|
||||
const hitTemplate = function(hit) {
|
||||
const url = hit.url;
|
||||
const title = hit._highlightResult.title.value;
|
||||
const content = hit._highlightResult.html.value;
|
||||
const hightlight = hit._highlightResult;
|
||||
const title = hightlight.title && hightlight.title.value || "";
|
||||
const content = hightlight.html && hightlight.html.value || "";
|
||||
|
||||
return `
|
||||
<div class="list__item">
|
||||
|
@ -44,11 +45,18 @@ search.addWidget(
|
|||
instantsearch.widgets.hits({
|
||||
container: '.search-hits',
|
||||
templates: {
|
||||
item: hitTemplate
|
||||
item: hitTemplate,
|
||||
empty: '{{ site.data.ui-text[site.locale].search_algolia_no_results | default: "No results" }}',
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
// Starting the search
|
||||
search.start();
|
||||
// Starting the search only when toggle is clicked
|
||||
$(document).ready(function () {
|
||||
$(".search__toggle").on("click", function() {
|
||||
if(!search.started) {
|
||||
search.start();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue