redirecter for ao3 that adds opengraph metadata

fix opengraph stuff

Changed files
+4 -4
src
app
works
[workId]
+1 -1
src/app/works/[workId]/chapters/[chapterId]/opengraph-image.jsx
···
const { workId, chapterId } = await params
const addr = `works/${workId}/chapters/${chapterId}`
const data = await getWork({workId: workId, chapterId: chapterId})
-
if (data.locked) return OGImageLocked({theme: theme})
const imageParams = await sanitizeData({type: 'work', data: data, props: defaults})
const theme = imageParams.theme
const baseFont = baseFonts[imageParams.baseFont].displayName
···
const { workId, chapterId } = await params
const addr = `works/${workId}/chapters/${chapterId}`
const data = await getWork({workId: workId, chapterId: chapterId})
+
if (data.locked) return OGImageLocked({theme: process.env.DEFAULT_THEME})
const imageParams = await sanitizeData({type: 'work', data: data, props: defaults})
const theme = imageParams.theme
const baseFont = baseFonts[imageParams.baseFont].displayName
+1 -1
src/app/works/[workId]/chapters/[chapterId]/page.js
···
if (work.locked) {
return {
title: 'Locked Work',
-
description: 'This but this work is locked to the public. Log in to see it!',
metadataBase: new URL('https://'+process.env.DOMAIN)
}
}
···
if (work.locked) {
return {
title: 'Locked Work',
+
description: 'This work is locked to the public. Log in to see it!',
metadataBase: new URL('https://'+process.env.DOMAIN)
}
}
+1 -1
src/app/works/[workId]/opengraph-image.jsx
···
const { workId } = await params
const addr = `works/${workId}`
const data = await getWork({workId: workId})
-
if (data.locked) return OGImageLocked({theme: theme})
const imageParams = await sanitizeData({type: 'work', data: data, props: defaults})
const theme = imageParams.theme
const baseFont = baseFonts[imageParams.baseFont].displayName
···
const { workId } = await params
const addr = `works/${workId}`
const data = await getWork({workId: workId})
+
if (data.locked) return OGImageLocked({theme: process.env.DEFAULT_THEME})
const imageParams = await sanitizeData({type: 'work', data: data, props: defaults})
const theme = imageParams.theme
const baseFont = baseFonts[imageParams.baseFont].displayName
+1 -1
src/app/works/[workId]/page.js
···
if (work.locked) {
return {
title: 'Locked Work',
-
description: 'This but this work is locked to the public. Log in to see it!',
metadataBase: new URL('https://'+process.env.DOMAIN)
}
}
···
if (work.locked) {
return {
title: 'Locked Work',
+
description: 'This work is locked to the public. Log in to see it!',
metadataBase: new URL('https://'+process.env.DOMAIN)
}
}