add netlify builder to capture social images
plus also added an invalidator that should invalidate the image each month
This commit is contained in:
@@ -43,6 +43,7 @@ export default () => (
|
||||
<section className="">
|
||||
<h1>
|
||||
<span className="font-ropa-sans">404 Page Not Found</span>
|
||||
<div className="text-sm">{location.href} 🤷</div>
|
||||
</h1>
|
||||
</section>
|
||||
</MainLayout>
|
||||
|
||||
@@ -9,9 +9,11 @@ import { Toaster } from '@redwoodjs/web/toast'
|
||||
const ProjectPage = ({ userName, projectTitle }) => {
|
||||
const { currentUser } = useAuth()
|
||||
const [state, thunkDispatch] = useIdeState()
|
||||
const cacheInvalidator = new Date().toISOString().split('-').slice(0, 2).join('-')
|
||||
const socialImageUrl = `/.netlify/functions/og-image-generator/${userName}/${projectTitle}/og-image-${cacheInvalidator}.jpg`
|
||||
return (
|
||||
<>
|
||||
<Seo title={projectTitle} description={projectTitle} lang="en-US" />
|
||||
<Seo title={projectTitle} description={projectTitle} socialImageUrl={socialImageUrl} lang="en-US" />
|
||||
<Toaster timeout={1500} />
|
||||
<IdeContext.Provider value={{ state, thunkDispatch, project: null }}>
|
||||
<ProjectCell
|
||||
|
||||
Reference in New Issue
Block a user