migrate away from deprecated svelte 4 syntax, let ai chatbot use user's keys that's never sent to server, get threlte/studio working, refactor search results

This commit is contained in:
2025-01-23 17:33:08 -05:00
parent d08171ef14
commit c305246dee
34 changed files with 1333 additions and 1223 deletions

View File

@@ -23,10 +23,10 @@ export interface Post {
id: string;
}
// Update the Data interface to match the new structure
interface Data {
metadata: Metadata;
default: any; // The component itself
// eslint-disable-next-line @typescript-eslint/no-explicit-any
default: any;
}
function isData(obj: unknown): obj is Data {
@@ -75,9 +75,8 @@ export const fetchMarkdownPosts = async (
return undefined;
}
const { metadata } = data;
// Use the new render function from svelte/server
const { html } = render(data.default, {});
const content = html.replace(/<[^>]*>/g, '');
const { body } = render(data.default, {});
const content = body.replace(/<[^>]*>/g, '');
const section = path.split('/')[3];
const filename = path.split('/').pop()?.slice(0, -3);