Browse Source

update quick-search.js (minor URL and CSS changes).

This file has been in the repo. for a while -- I copied it over from my co-web
project. But, I hadn't touched it or integrated into this website until
now. The changes in this commit are mostly minor changes which bring the URL's
for the Meilisearch instance this website connects to and change the CSS classes
to match the ones used in this project (and not my co-web) project.
stable
Craig Oates 2 years ago
parent
commit
2515803ce0
  1. 10
      static/js/quick-search.js

10
static/js/quick-search.js

@ -20,16 +20,16 @@ let apiKey = "";
if (location.hostname === "localhost"
|| location.hostname === "127.0.0.1"
|| location.hostname === "beta.craigoates.net") {
server = "http://beta-search.craigoates.net";
|| location.hostname === "beta.nera.com") {
server = "http://localhost:7700";
apiKey= "meilisearch-beta-key";
} else {
server = "https://search.craigoates.net";
server = "https://www.nera.com";
apiKey = "meilisearch-production-key-26-07-2022";
}
const search = instantsearch({
indexName: "project",
indexName: "nera",
searchClient: instantMeiliSearch(
server,
apiKey,
@ -50,7 +50,7 @@ search.addWidgets([
container: "#hits",
templates: {
item: `
<a class="ui-link-search-card" href="{{server}}/{{relative-path}}">
<a class="fe-search-hit" href="{{server}}/{{relative-path}}">
<img src="{{server}}/{{thumbnail-path}}"/>
<span>{{#helpers.highlight}}{"attribute": "title"}{{/helpers.highlight}}</span>
</a>

Loading…
Cancel
Save