@@ -12,8 +12,13 @@ import NamePage from "@/components/shared/NamePage";
1212import SubNamePage from "@/components/shared/SubNamePage" ;
1313import { getProjectBySlug , projects } from "@/lib/projects" ;
1414import {
15+ PROJECT_IMAGE_HEIGHT ,
16+ PROJECT_IMAGE_WIDTH ,
17+ projectImageAlt ,
1518 projectImageCaption ,
19+ projectImageEncodingFormat ,
1620 projectImageTitle ,
21+ projectOgImage ,
1722 projectPagePath ,
1823} from "@/lib/seo-images" ;
1924import { absoluteUrl , brandOgImages , siteConfig } from "@/lib/site" ;
@@ -42,7 +47,13 @@ export async function generateMetadata({
4247 }
4348
4449 const pageUrl = absoluteUrl ( projectPagePath ( project ) ) ;
50+ const imageUrl = absoluteUrl ( project . imageUrl ) ;
51+ const imageTitle = projectImageTitle ( project ) ;
4552 const title = `${ project . title } | Cipher Unit Open Source Project` ;
53+ const techKeywords = project . tech
54+ . split ( "•" )
55+ . map ( ( part ) => part . trim ( ) )
56+ . filter ( Boolean ) ;
4657
4758 return {
4859 title : { absolute : title } ,
@@ -52,8 +63,13 @@ export async function generateMetadata({
5263 "Cipher Unit" ,
5364 "CipherUnit" ,
5465 "open source" ,
66+ "open source project" ,
67+ "developer tools" ,
5568 ...project . programmingLanguages ,
69+ ...techKeywords ,
5670 ] ,
71+ category : "Technology" ,
72+ classification : "Software Development" ,
5773 alternates : {
5874 canonical : projectPagePath ( project ) ,
5975 } ,
@@ -78,20 +94,17 @@ export async function generateMetadata({
7894 siteName : siteConfig . name ,
7995 title : `${ project . title } — Cipher Unit` ,
8096 description : project . description ,
81- images : [
82- {
83- url : project . imageUrl ,
84- alt : projectImageTitle ( project ) ,
85- type : "image/png" as const ,
86- } ,
87- ...brandOgImages ( `${ project . title } by Cipher Unit` ) ,
88- ] ,
97+ images : [ projectOgImage ( project ) , ...brandOgImages ( `${ project . title } by Cipher Unit` ) ] ,
8998 } ,
9099 twitter : {
91100 card : "summary_large_image" ,
92101 title : `${ project . title } — Cipher Unit` ,
93102 description : project . description ,
94- images : [ project . imageUrl ] ,
103+ images : [ imageUrl ] ,
104+ } ,
105+ other : {
106+ "og:image:alt" : imageTitle ,
107+ "image" : imageUrl ,
95108 } ,
96109 } ;
97110}
@@ -106,6 +119,9 @@ export default async function ProjectPage({ params }: ProjectPageProps) {
106119
107120 const imageTitle = projectImageTitle ( project ) ;
108121 const imageCaption = projectImageCaption ( project ) ;
122+ const imageAlt = projectImageAlt ( project ) ;
123+ const absoluteImageUrl = absoluteUrl ( project . imageUrl ) ;
124+ const encodingFormat = projectImageEncodingFormat ( project . imageUrl ) ;
109125
110126 return (
111127 < main
@@ -137,28 +153,30 @@ export default async function ProjectPage({ params }: ProjectPageProps) {
137153 < meta itemProp = "creator" content = "Cipher Unit" />
138154
139155 < figure
140- className = "relative aspect-video w-full overflow-hidden"
156+ className = "relative aspect-video w-full overflow-hidden bg-[#2c3138] "
141157 itemProp = "image"
142158 itemScope
143159 itemType = "https://schema.org/ImageObject"
144160 >
145- < meta
146- itemProp = "contentUrl"
147- content = { absoluteUrl ( project . imageUrl ) }
148- />
149- < meta itemProp = "url" content = { absoluteUrl ( project . imageUrl ) } />
161+ < meta itemProp = "contentUrl" content = { absoluteImageUrl } />
162+ < meta itemProp = "url" content = { absoluteImageUrl } />
150163 < meta itemProp = "name" content = { imageTitle } />
151164 < meta itemProp = "caption" content = { imageCaption } />
165+ < meta itemProp = "description" content = { imageCaption } />
166+ < meta itemProp = "encodingFormat" content = { encodingFormat } />
167+ < meta itemProp = "width" content = { String ( PROJECT_IMAGE_WIDTH ) } />
168+ < meta itemProp = "height" content = { String ( PROJECT_IMAGE_HEIGHT ) } />
169+ < meta itemProp = "representativeOfPage" content = "true" />
152170 < Image
153171 src = { project . imageUrl }
154- overrideSrc = { absoluteUrl ( project . imageUrl ) }
155- alt = { ` ${ project . title } open source software developed by Cipher Unit (CipherUnit). ${ project . description } ` }
172+ overrideSrc = { absoluteImageUrl }
173+ alt = { imageAlt }
156174 title = { imageTitle }
157175 fill
158176 priority
159177 quality = { 90 }
160178 sizes = "(max-width: 1024px) 100vw, 1152px"
161- className = "object-cover "
179+ className = "object-contain "
162180 />
163181 < figcaption className = "sr-only" > { imageCaption } </ figcaption >
164182 </ figure >
0 commit comments