mirror of
https://github.com/Afilmory/afilmory
synced 2026-04-24 23:05:05 +00:00
@@ -11,8 +11,10 @@
|
|||||||
"build": "sh scripts/build.sh",
|
"build": "sh scripts/build.sh",
|
||||||
"build:jpg": "node scripts/webp-to-jpg.js",
|
"build:jpg": "node scripts/webp-to-jpg.js",
|
||||||
"build:next": "next build",
|
"build:next": "next build",
|
||||||
|
"deploy": "npm run pages:build && wrangler pages deploy",
|
||||||
"dev": "next dev",
|
"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"
|
"start": "next start"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export const GET = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Insert meta open graph tags and twitter meta tags
|
// Insert meta open graph tags and twitter meta tags
|
||||||
createAndInsertOpenGraphMeta(document, photo)
|
createAndInsertOpenGraphMeta(document, photo, request)
|
||||||
|
|
||||||
return new Response(document.documentElement.outerHTML, {
|
return new Response(document.documentElement.outerHTML, {
|
||||||
headers: {
|
headers: {
|
||||||
@@ -48,11 +48,12 @@ export const GET = async (
|
|||||||
const createAndInsertOpenGraphMeta = (
|
const createAndInsertOpenGraphMeta = (
|
||||||
document: HTMLDocument,
|
document: HTMLDocument,
|
||||||
photo: PhotoManifest,
|
photo: PhotoManifest,
|
||||||
|
request: NextRequest,
|
||||||
) => {
|
) => {
|
||||||
const og = {
|
const og = {
|
||||||
name: photo.id,
|
name: photo.id,
|
||||||
description: photo.description,
|
description: photo.description,
|
||||||
image: photo.originalUrl,
|
image: `${request.nextUrl.origin}/og/${photo.id}`,
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const [key, value] of Object.entries(og)) {
|
for (const [key, value] of Object.entries(og)) {
|
||||||
|
|||||||
8
apps/ssr/wrangler.jsonc
Normal file
8
apps/ssr/wrangler.jsonc
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"name": "iris-ssr",
|
||||||
|
"compatibility_date": "2024-09-23",
|
||||||
|
"compatibility_flags": [
|
||||||
|
"nodejs_compat"
|
||||||
|
],
|
||||||
|
"pages_build_output_dir": ".vercel/output/static"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user