diff --git a/.vscode/settings.json b/.vscode/settings.json index 79af9c7d49..794d579bcf 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,7 @@ { - "explorer.excludeGitIgnore": false, - "search.useParentIgnoreFiles": false, - "search.useIgnoreFiles": false, + "explorer.excludeGitIgnore": true, + "search.useParentIgnoreFiles": true, + "search.useIgnoreFiles": true, "files.watcherExclude": { "**/routeTree.gen.ts": true }, @@ -23,5 +23,10 @@ "rust-analyzer.checkOnSave": true, "rust-analyzer.check.allTargets": true, "rust-analyzer.cargo.targetDir": "target/analyzer", - "rust-analyzer.cargo.extraEnv": { "MACOSX_DEPLOYMENT_TARGET": "14.2" } + "rust-analyzer.cargo.extraEnv": { "MACOSX_DEPLOYMENT_TARGET": "14.2" }, + "deno.enable": true, + "deno.lint": true, + "deno.enablePaths": [ + "apps/web/netlify/edge-functions" + ] } diff --git a/apps/web/netlify.toml b/apps/web/netlify.toml index 8f4a6929c8..e8c4fcabb3 100644 --- a/apps/web/netlify.toml +++ b/apps/web/netlify.toml @@ -6,6 +6,10 @@ publish = "dist/client" VITE_APP_URL = "https://hyprnote.com" NODE_VERSION = "22" +[[edge_functions]] +function = "og" +path = "/og" + [images] # https://docs.netlify.com/build/image-cdn/overview/#remote-path remote_images = [ diff --git a/apps/web/netlify/edge-functions/deno.json b/apps/web/netlify/edge-functions/deno.json new file mode 100644 index 0000000000..a8e0f0ad09 --- /dev/null +++ b/apps/web/netlify/edge-functions/deno.json @@ -0,0 +1,7 @@ +{ + "lock": false, + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "https://esm.sh/react@18.2.0" + } +} diff --git a/apps/web/netlify/edge-functions/og.tsx b/apps/web/netlify/edge-functions/og.tsx new file mode 100644 index 0000000000..3027da2de8 --- /dev/null +++ b/apps/web/netlify/edge-functions/og.tsx @@ -0,0 +1,76 @@ +// deno-lint-ignore no-import-prefix +import { ImageResponse } from "https://deno.land/x/og_edge@0.0.6/mod.ts"; + +export default function handler(req: Request) { + const url = new URL(req.url); + const title = url.searchParams.get("title") || "Hyprnote"; + const description = url.searchParams.get("description") || "AI Meeting Notes"; + + return new ImageResponse( + ( +
+
+
+ {title} +
+
+ {description} +
+
+ Hyprnote +
+
+
+ ), + ); +} + +export const config = { + path: "/og", + cache: "manual", +};