File tree Expand file tree Collapse file tree 9 files changed +19
-29
lines changed
Expand file tree Collapse file tree 9 files changed +19
-29
lines changed Original file line number Diff line number Diff line change @@ -215,8 +215,8 @@ const BrutalistBlogPostPage = () => {
215215 const currentPostIndex = post . seriesPosts ?. findIndex (
216216 ( item ) => item . slug === currentSlug ,
217217 ) ;
218- const prevPost = post . seriesPosts ?. [ currentPostIndex + 1 ] ;
219- const nextPost = post . seriesPosts ?. [ currentPostIndex - 1 ] ;
218+ const prevPost = post . seriesPosts ?. [ currentPostIndex - 1 ] ;
219+ const nextPost = post . seriesPosts ?. [ currentPostIndex + 1 ] ;
220220
221221 return (
222222 < div className = "min-h-screen bg-[#050505] text-white selection:bg-emerald-500/30 pb-32 relative" >
Original file line number Diff line number Diff line change @@ -354,8 +354,8 @@ const DokumentBlogPostPage = () => {
354354 const currentPostIndex = post . seriesPosts ?. findIndex (
355355 ( item ) => item . slug === currentSlug ,
356356 ) ;
357- const prevPost = post . seriesPosts ?. [ currentPostIndex + 1 ] ;
358- const nextPost = post . seriesPosts ?. [ currentPostIndex - 1 ] ;
357+ const prevPost = post . seriesPosts ?. [ currentPostIndex - 1 ] ;
358+ const nextPost = post . seriesPosts ?. [ currentPostIndex + 1 ] ;
359359
360360 return (
361361 < div className = "min-h-screen bg-[#f3f3f3] text-[#111] font-sans relative overflow-x-hidden selection:bg-emerald-500/20" >
Original file line number Diff line number Diff line change @@ -363,8 +363,8 @@ const DossierBlogPostPage = () => {
363363 const currentPostIndex = post . seriesPosts ?. findIndex (
364364 ( item ) => item . slug === currentSlug ,
365365 ) ;
366- const prevPost = post . seriesPosts ?. [ currentPostIndex + 1 ] ;
367- const nextPost = post . seriesPosts ?. [ currentPostIndex - 1 ] ;
366+ const prevPost = post . seriesPosts ?. [ currentPostIndex - 1 ] ;
367+ const nextPost = post . seriesPosts ?. [ currentPostIndex + 1 ] ;
368368
369369 return (
370370 < div className = "min-h-screen bg-[#f3f3f3] text-[#111] overflow-y-auto selection:bg-black selection:text-white custom-scrollbar font-sans relative" >
Original file line number Diff line number Diff line change @@ -286,8 +286,8 @@ const EditorialBlogPostPage = () => {
286286 const currentPostIndex = post . seriesPosts ?. findIndex (
287287 ( item ) => item . slug === currentSlug ,
288288 ) ;
289- const prevPost = post . seriesPosts ?. [ currentPostIndex + 1 ] ;
290- const nextPost = post . seriesPosts ?. [ currentPostIndex - 1 ] ;
289+ const prevPost = post . seriesPosts ?. [ currentPostIndex - 1 ] ;
290+ const nextPost = post . seriesPosts ?. [ currentPostIndex + 1 ] ;
291291
292292 return (
293293 < div className = { `min-h-screen transition-colors duration-500 font-instr-serif ${ isInvert ? 'bg-[#1a1a1a] text-[#f4f4f4]' : 'bg-[#f4f4f4] text-[#1a1a1a]' } ` } >
Original file line number Diff line number Diff line change @@ -281,11 +281,11 @@ const OldBlogPostPage = () => {
281281 ? post . seriesPosts . findIndex ( ( item ) => item . slug === currentSlug )
282282 : - 1 ;
283283 const prevPost =
284- post . seriesPosts && currentPostIndex < post . seriesPosts . length - 1
285- ? post . seriesPosts [ currentPostIndex + 1 ]
284+ post . seriesPosts && currentPostIndex > 0
285+ ? post . seriesPosts [ currentPostIndex - 1 ]
286286 : null ;
287287 const nextPost =
288- currentPostIndex > 0 ? post . seriesPosts [ currentPostIndex - 1 ] : null ;
288+ currentPostIndex < post . seriesPosts . length - 1 ? post . seriesPosts [ currentPostIndex + 1 ] : null ;
289289
290290 const backLink = post . attributes . series
291291 ? `/blog/series/${ post . attributes . series . slug } `
Original file line number Diff line number Diff line change @@ -435,8 +435,8 @@ const TerminalBlogPostPage = () => {
435435 const currentPostIndex = post . seriesPosts ?. findIndex (
436436 ( item ) => item . slug === currentSlug ,
437437 ) ;
438- const prevPost = post . seriesPosts ?. [ currentPostIndex + 1 ] ;
439- const nextPost = post . seriesPosts ?. [ currentPostIndex - 1 ] ;
438+ const prevPost = post . seriesPosts ?. [ currentPostIndex - 1 ] ;
439+ const nextPost = post . seriesPosts ?. [ currentPostIndex + 1 ] ;
440440
441441 const backLink = post . attributes . series
442442 ? `/blog/series/${ post . attributes . series . slug } `
Original file line number Diff line number Diff line change @@ -180,8 +180,8 @@ const TerminalGreenBlogPostPage = () => {
180180 const currentPostIndex = post . seriesPosts ?. findIndex (
181181 ( item ) => item . slug === currentSlug ,
182182 ) ;
183- const prevPost = post . seriesPosts ?. [ currentPostIndex + 1 ] ;
184- const nextPost = post . seriesPosts ?. [ currentPostIndex - 1 ] ;
183+ const prevPost = post . seriesPosts ?. [ currentPostIndex - 1 ] ;
184+ const nextPost = post . seriesPosts ?. [ currentPostIndex + 1 ] ;
185185
186186 return (
187187 < div className = "min-h-screen bg-black text-emerald-500 font-mono relative overflow-x-hidden selection:bg-emerald-500 selection:text-black" >
Original file line number Diff line number Diff line change @@ -21,11 +21,7 @@ const BrutalistSeriesPage = () => {
2121
2222 const filteredPosts = processedPosts
2323 . filter ( ( post ) => post . series && post . series . slug === seriesSlug )
24- . sort ( ( a , b ) => {
25- const dateA = new Date ( a . updated || a . date ) ;
26- const dateB = new Date ( b . updated || b . date ) ;
27- return dateB - dateA ;
28- } ) ;
24+ . sort ( ( a , b ) => ( a . seriesIndex || 0 ) - ( b . seriesIndex || 0 ) ) ;
2925
3026 if ( filteredPosts . length > 0 ) {
3127 setSeriesPosts ( filteredPosts ) ;
@@ -112,6 +108,7 @@ const BrutalistSeriesPage = () => {
112108 < PostItem
113109 key = { post . slug }
114110 { ...post }
111+ seriesIndex = { post . seriesIndex }
115112 slug = { `series/${ seriesSlug } /${ post . slug } ` }
116113 isActive = { activePost ?. slug === post . slug }
117114 onHover = { setActivePost }
Original file line number Diff line number Diff line change @@ -19,14 +19,7 @@ const LuxeSeriesPage = () => {
1919
2020 const filteredPosts = processedPosts
2121 . filter ( ( post ) => post . series && post . series . slug === seriesSlug )
22- . sort ( ( a , b ) => {
23- const dateA = new Date ( a . updated || a . date ) ;
24- const dateB = new Date ( b . updated || b . date ) ;
25- // Default to oldest first for series reading order?
26- // Original code used newest first (B-A). Let's stick to reading order (A-B) for Luxe UX if it's a sequence?
27- // Actually, Brutalist was B-A. Let's keep B-A for consistency unless specified.
28- return dateB - dateA ;
29- } ) ;
22+ . sort ( ( a , b ) => ( a . seriesIndex || 0 ) - ( b . seriesIndex || 0 ) ) ;
3023
3124 if ( filteredPosts . length > 0 ) {
3225 setSeriesPosts ( filteredPosts ) ;
@@ -100,7 +93,7 @@ const LuxeSeriesPage = () => {
10093 < div className = "flex flex-col md:flex-row md:items-center justify-between gap-6" >
10194 < div className = "flex items-start gap-6" >
10295 < span className = "font-playfairDisplay text-4xl text-[#1A1A1A]/10 group-hover:text-[#8D4004]/20 transition-colors" >
103- { String ( seriesPosts . length - index ) . padStart ( 2 , '0' ) }
96+ { String ( post . seriesIndex ) . padStart ( 2 , '0' ) }
10497 </ span >
10598 < div >
10699 < h3 className = "font-playfairDisplay text-2xl text-[#1A1A1A] group-hover:italic transition-all mb-2" >
You can’t perform that action at this time.
0 commit comments