fix: update build script

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei
2025-06-08 15:55:10 +08:00
parent 588c9ab5ea
commit f1705e62a1
3 changed files with 14 additions and 3 deletions

View File

@@ -11,8 +11,10 @@
"build": "sh scripts/build.sh",
"build:jpg": "node scripts/webp-to-jpg.js",
"build:next": "next build",
"deploy": "npm run pages:build && wrangler pages deploy",
"dev": "next dev",
"pages:build": "npx @cloudflare/next-on-pages",
"pages:build": "pnpm dlx @cloudflare/next-on-pages",
"preview": "npm run pages:build && wrangler pages dev",
"start": "next start"
},
"dependencies": {

View File

@@ -35,7 +35,7 @@ export const GET = async (
}
// Insert meta open graph tags and twitter meta tags
createAndInsertOpenGraphMeta(document, photo)
createAndInsertOpenGraphMeta(document, photo, request)
return new Response(document.documentElement.outerHTML, {
headers: {
@@ -48,11 +48,12 @@ export const GET = async (
const createAndInsertOpenGraphMeta = (
document: HTMLDocument,
photo: PhotoManifest,
request: NextRequest,
) => {
const og = {
name: photo.id,
description: photo.description,
image: photo.originalUrl,
image: `${request.nextUrl.origin}/og/${photo.id}`,
}
for (const [key, value] of Object.entries(og)) {

8
apps/ssr/wrangler.jsonc Normal file
View File

@@ -0,0 +1,8 @@
{
"name": "iris-ssr",
"compatibility_date": "2024-09-23",
"compatibility_flags": [
"nodejs_compat"
],
"pages_build_output_dir": ".vercel/output/static"
}