@@ -8,6 +8,8 @@ const notion = new Client({
88const space = process . env . NEXT_PUBLIC_CONTENTFUL_SPACE_ID ;
99const accessToken = process . env . NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN ;
1010
11+ const PLACEHOLDER_IMAGE = '/images/placeholder.webp' ;
12+
1113const safeExtract = ( value , fallback = '' ) => {
1214 const result = extractPlainText ( value || [ ] ) ;
1315 return result || fallback ;
@@ -26,7 +28,7 @@ function formatMemberData(page) {
2628 name : safeExtract ( properties . name ?. title ) ,
2729 title : properties . title ?. select ?. name || '' ,
2830 image : {
29- url : properties . image ?. url || ''
31+ url : properties . image ?. url || PLACEHOLDER_IMAGE
3032 } ,
3133 linkedIn : properties . linkedIn ?. url || properties . linkedin ?. url || '' ,
3234 classOf : properties . class ?. select ?. name || '' ,
@@ -47,7 +49,7 @@ function formatProjectData(page) {
4749 team : properties . team ?. people ?. map ( person => person . name || person . id ) . join ( ', ' ) || '' ,
4850 description : safeExtract ( properties . description ?. rich_text || [ ] ) ,
4951 thumbnail : {
50- url : properties . thumbnail ?. url || '' ,
52+ url : properties . thumbnail ?. url || PLACEHOLDER_IMAGE ,
5153 description : safeExtract ( properties . thumbnailDescription ?. rich_text ) || ''
5254 } ,
5355 urlSlug : safeExtract ( properties . urlSlug ?. rich_text ) ||
@@ -60,7 +62,7 @@ function formatPartnerData(page) {
6062 const properties = page . properties ;
6163 return {
6264 name : safeExtract ( properties . name ?. title ) ,
63- logoUrl : properties . logoUrl ?. url || '' ,
65+ logoUrl : properties . logoUrl ?. url || PLACEHOLDER_IMAGE ,
6466 link : properties . link ?. url || '' ,
6567 tier : properties . tier ?. select ?. name || '' ,
6668 order : properties . order ?. number ?? 0 ,
@@ -85,7 +87,7 @@ function formatTimelineStep(page) {
8587 header : safeExtract ( properties . header ?. rich_text || [ ] ) ,
8688 body : safeExtract ( properties . bodyText ?. rich_text || [ ] ) ,
8789 image : {
88- url : properties . imageUrl ?. url || '' ,
90+ url : properties . imageUrl ?. url || PLACEHOLDER_IMAGE ,
8991 description : safeExtract ( properties . imageDescription ?. rich_text || [ ] ) ,
9092 } ,
9193 } ;
@@ -148,7 +150,7 @@ export async function fetchProjectDetail(urlSlug) {
148150 title : safeExtract ( properties . title ?. title || properties . name ?. title || [ ] ) ,
149151 description : safeExtract ( properties . description ?. rich_text || [ ] ) ,
150152 thumbnail : {
151- url : properties . thumbnail ?. url || properties . thumbnail ?. files ?. [ 0 ] ?. file ?. url || '' ,
153+ url : properties . thumbnail ?. url || properties . thumbnail ?. files ?. [ 0 ] ?. file ?. url || PLACEHOLDER_IMAGE ,
152154 description : safeExtract ( properties . thumbnail_description ?. rich_text || [ ] )
153155 } ,
154156 finalProductLink : properties . final_product_link ?. url || '' ,
@@ -169,13 +171,13 @@ export async function fetchProjectDetail(urlSlug) {
169171 pmtlCollection : {
170172 items : properties . pmtl ?. people ?. map ( person => ( {
171173 name : person . name || 'Team Member' ,
172- image : { url : person . avatar_url || '' } ,
174+ image : { url : person . avatar_url || PLACEHOLDER_IMAGE } ,
173175 } ) ) || [ ]
174176 } ,
175177 teamMembersCollection : {
176178 items : properties . team ?. people ?. map ( person => ( {
177179 name : person . name || 'Team Member' ,
178- image : { url : person . avatar_url || '' } ,
180+ image : { url : person . avatar_url || PLACEHOLDER_IMAGE } ,
179181 } ) ) || [ ]
180182 }
181183 } ;
@@ -278,7 +280,7 @@ export async function fetchMemberDetail(urlSlug) {
278280 name : safeExtract ( properties . name ?. title || [ ] ) ,
279281 title : properties . title ?. select ?. name || '' ,
280282 image : {
281- url : properties . image ?. url || '' ,
283+ url : properties . image ?. url || PLACEHOLDER_IMAGE ,
282284 description : safeExtract ( properties . name ?. title || [ ] ) + ' profile photo'
283285 } ,
284286 linkedIn : properties . linkedin ?. url || '' ,
0 commit comments