Browse Source

update full-search.js (mostly CSS classes).

Because I copied over the code from my co-web project, the code in this file has
CSS classes referring to that project. This commit updates those classes to fall
in-line with the CSS/design of this website.
stable
Craig Oates 2 years ago
parent
commit
6d60cfa86a
  1. 20
      static/js/full-search.js

20
static/js/full-search.js

@ -2,7 +2,7 @@
Full Search Full Search
================================================================================ ================================================================================
This file's main focus in providing the Meilisearch features to the This file's main focus in providing the Meilisearch features to the
search/index.html template. search.html template.
For more information on Meilisearch, use: For more information on Meilisearch, use:
@ -41,7 +41,7 @@ const search = instantsearch({
search.addWidgets([ search.addWidgets([
instantsearch.widgets.searchBox({ instantsearch.widgets.searchBox({
container: "#searchbox", container: "#searchbox",
placeholder: "Search...", placeholder: "Search the archive here...",
}), }),
instantsearch.widgets.clearRefinements({ instantsearch.widgets.clearRefinements({
container: "#clear-refinements" container: "#clear-refinements"
@ -59,7 +59,7 @@ search.addWidgets([
attribute: "keywords" attribute: "keywords"
}), }),
instantsearch.widgets.configure({ instantsearch.widgets.configure({
hitsPerPage: 30, hitsPerPage: 50,
snippetEllipsisText: "...", snippetEllipsisText: "...",
attributesToSnippet: ["title:100"] attributesToSnippet: ["title:100"]
}), }),
@ -67,20 +67,18 @@ search.addWidgets([
container: "#hits", container: "#hits",
templates: { templates: {
item: ` item: `
<a class="ui-link-card" href="{{server}}/{{relative-path}}"> <a class="fe-search-hit" href="{{server}}/{{relative-path}}">
<div> <div>
<img src="{{server}}/{{thumbnail-path}}"/> <img src="{{server}}/{{thumbnail-path}}"/>
<div class="ui-card-text"> <div class="fe-search-hit-text">
<span class="ui-card-title"> <span class="fe-search-hit-title">
{{#helpers.highlight}}{"attribute": "title"}{{/helpers.highlight}} {{#helpers.highlight}}{"attribute": "title"}{{/helpers.highlight}}
</span> </span>
<span class="ui-card-secondary"> <span class="fe-search-hit-secondary">
{{#helpers.highlight}}{"attribute": "year"}{{/helpers.highlight}}
</span>
<span class="ui-card-secondary">
{{#helpers.highlight}}{"attribute": "month"}{{/helpers.highlight}} {{#helpers.highlight}}{"attribute": "month"}{{/helpers.highlight}}
{{#helpers.highlight}}{"attribute": "year"}{{/helpers.highlight}}
</span> </span>
<span class="ui-card-keywords"> <span class="fe-search-hit-keywords">
{{keywords}} {{keywords}}
</span> </span>
</div> </div>

Loading…
Cancel
Save