init commit,

This commit is contained in:
louiscklaw
2025-05-28 09:55:51 +08:00
commit efe70ceb69
8042 changed files with 951668 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
# Open Graph Image Generation
Generate Open Graph images with Deno and Supabase Edge Functions, no framework needed. This is a fork of the awesome [@vercel/og](https://www.npmjs.com/package/@vercel/og), ported to run on Deno.
- Docs: https://deno.land/x/og_edge@0.0.2
## Run locally
```bash
supabase functions serve --no-verify-jwt
```
Navigate to http://localhost:54321/functions/v1/opengraph
## Deploy
```bash
supabase functions deploy opengraph --no-verify-jwt
```

View File

@@ -0,0 +1,32 @@
import React from 'https://esm.sh/react@18.2.0?deno-std=0.177.0'
import { ImageResponse } from 'https://deno.land/x/og_edge@0.0.4/mod.ts'
export function handler(req: Request) {
return new ImageResponse(
(
<div
style={{
fontSize: 100,
color: 'black',
background: 'white',
width: '100%',
height: '100%',
padding: '50px 200px',
textAlign: 'center',
justifyContent: 'center',
alignItems: 'center',
display: 'flex',
}}
>
NICE! 🔥
</div>
),
{
width: 1200,
height: 630,
// Supported options: 'twemoji', 'blobmoji', 'noto', 'openmoji', 'fluent', 'fluentFlat'
// Default to 'twemoji'
emoji: 'twemoji',
}
)
}

View File

@@ -0,0 +1,9 @@
// Follow this setup guide to integrate the Deno language server with your editor:
// https://deno.land/manual/getting_started/setup_your_environment
// This enables autocomplete, go to definition, etc.
import { handler } from './handler.tsx'
console.log(`Function "opengraph" up and running!`)
Deno.serve(handler)