Skip to content

Commit

Permalink
Remove baseurl
Browse files Browse the repository at this point in the history
  • Loading branch information
npentrel committed Jan 27, 2025
1 parent d161160 commit 0b6e713
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
5 changes: 2 additions & 3 deletions assets/js/models.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ let api = "";
if (document.getElementsByClassName("mr-component").length){
api = document.getElementsByClassName("mr-component")[0].id;
}
let baseURL = params.baseURL.substr(-1) === '/' ? params.baseURL.slice(0, -1) : params.baseURL;

const typesenseInstantsearchAdapter = new TypesenseInstantSearchAdapter({
server: {
Expand Down Expand Up @@ -142,7 +141,7 @@ if (mlmodel) {
hitsPerPage: 5,
};
itemtemplateML = `
<div class="name"><p><a href="${baseURL}{{url}}"><code>{{#helpers.highlight}}{ "attribute": "model_id" }{{/helpers.highlight}}</code></a></p></div>
<div class="name"><p><a href="{{url}}"><code>{{#helpers.highlight}}{ "attribute": "model_id" }{{/helpers.highlight}}</code></a></p></div>
<div class="type">{{#helpers.highlight}}{ "attribute": "type" }{{/helpers.highlight}}</div>
<div class="framework">{{#helpers.highlight}}{ "attribute": "framework" }{{/helpers.highlight}}</div>
<div class="description">{{#helpers.highlight}}{ "attribute": "description" }{{/helpers.highlight}}</div>
Expand Down Expand Up @@ -230,7 +229,7 @@ if (scripts) {
hitsPerPage: 5,
};
itemtemplateScripts = `
<div class="name"><p><a href="${baseURL}{{url}}"><code>{{#helpers.highlight}}{ "attribute": "model_id" }{{/helpers.highlight}}</code></a></p></div>
<div class="name"><p><a href="{{url}}"><code>{{#helpers.highlight}}{ "attribute": "model_id" }{{/helpers.highlight}}</code></a></p></div>
<div class="description">{{#helpers.highlight}}{ "attribute": "description" }{{/helpers.highlight}}</div>
`;

Expand Down
10 changes: 4 additions & 6 deletions assets/js/tutorials.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,19 @@ const customRefinementList = instantsearch.connectors.connectRefinementList(
},
);

let baseURL = params.baseURL.substr(-1) === '/' ? params.baseURL.slice(0, -1) : params.baseURL;

search.addWidgets([
instantsearch.widgets.hits({
container: "#hits",
templates: {
item: `
<div class="col tutorial hover-card {{resource}}">
<a href="${baseURL}{{relpermalink}}" target="_blank">
<a href="{{relpermalink}}" target="_blank">
{{#webm}}
<div class="hover-card-video">
<div>
<video autoplay loop muted playsinline alt="{{videoAlt}}" width="100%" style="width: {{ .maxWidth }}" class="{{- if .class -}}{{ .class}}{{- end }} lozad">
<source data-src="${baseURL}{{webm}}" type="video/webm">
<source data-src="${baseURL}{{mp4}}" type="video/mp4">
<source data-src="{{webm}}" type="video/webm">
<source data-src="{{mp4}}" type="video/mp4">
There should have been a video here but your browser does not seem to support it.
</video>
</div>
Expand All @@ -116,7 +114,7 @@ search.addWidgets([
{{#image}}
<div class="hover-card-img">
<picture>
<img src="${baseURL}{{image}}" alt="{{imageAlt}}" loading="lazy">
<img src="{{image}}" alt="{{imageAlt}}" loading="lazy">
</picture>
</div>
{{/image}}
Expand Down

0 comments on commit 0b6e713

Please sign in to comment.