Skip to content

Commit

Permalink
refactor: drop use of loader
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 committed Sep 23, 2024
1 parent d5480a1 commit cac0a98
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 17 deletions.
1 change: 0 additions & 1 deletion packages/site/src/components/Navigation/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ function SearchForm({
const timeoutId = setTimeout(() => {
if (query != undefined && !!doSearch) {
doSearch(query).then((rawResults) => {
console.log({ rawResults });
setSearchResults(
rawResults &&
rankAndFilterResults(rawResults)
Expand Down
7 changes: 0 additions & 7 deletions themes/article/app/utils/loaders.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,6 @@ export async function getMystXrefJson(): Promise<Record<string, any> | null> {
return xrefs;
}

export async function getMystSearchJson(): Promise<Record<string, any> | null> {
const url = updateLink('/myst.search.json');
const response = await fetch(url).catch(() => null);
if (!response || response.status === 404) return null;
return await response.json();
}

export async function getFavicon(): Promise<{ contentType: string | null; buffer: Buffer } | null> {
const config = await getConfig();
const url = updateLink(config.options?.favicon) || 'https://mystmd.org/favicon.ico';
Expand Down
9 changes: 0 additions & 9 deletions themes/book/app/utils/loaders.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
} from '@myst-theme/common';
import { redirect } from '@remix-run/node';
import { responseNoArticle, responseNoSite, getDomainFromRequest } from '@myst-theme/site';
import type { MystSearchIndex } from '@myst-theme/search';

const CONTENT_CDN_PORT = process.env.CONTENT_CDN_PORT ?? '3100';
const CONTENT_CDN = `http://localhost:${CONTENT_CDN_PORT}`;
Expand Down Expand Up @@ -90,14 +89,6 @@ export async function getMystXrefJson(): Promise<Record<string, any> | null> {
return xrefs;
}

export async function getMystSearchJson(): Promise<MystSearchIndex | null> {
const url = updateLink('/myst.search.json');
console.log("REQUESTING SEARCH", url)
const response = await fetch(url).catch(() => null);
if (!response || response.status === 404) return null;
return await response.json();
}

export async function getFavicon(): Promise<{ contentType: string | null; buffer: Buffer } | null> {
const config = await getConfig();
const url = updateLink(config.options?.favicon) || 'https://mystmd.org/favicon.ico';
Expand Down

0 comments on commit cac0a98

Please sign in to comment.