@@ -13,7 +13,7 @@ import {
1313import GrainOverlay from '../components/GrainOverlay' ;
1414import CoffeeStain from '../components/CoffeeStain' ;
1515import CensoredPolaroid from '../components/CensoredPolaroid' ;
16- import Seo from '../components/Seo ' ;
16+ import useSeo from '../hooks/useSeo ' ;
1717import { calculateReadingTime } from '../utils/readingTime' ;
1818import { useAchievements } from '../context/AchievementContext' ;
1919import MarkdownLink from '../components/MarkdownLink' ;
@@ -103,6 +103,19 @@ const DossierBlogPostPage = () => {
103103 const [ modalLanguage , setModalLanguage ] = useState ( 'jsx' ) ;
104104 const [ modalImageSrc , setModalImageSrc ] = useState ( null ) ;
105105
106+ useSeo ( {
107+ title : post ? `${ post . attributes . title } | Fezcodex Archive` : 'Fezcodex' ,
108+ description : post ? post . body . substring ( 0 , 150 ) : '' ,
109+ keywords : post ?. attributes ?. tags ? post . attributes . tags . join ( ', ' ) : '' ,
110+ ogTitle : post ? `${ post . attributes . title } | Fezcodex` : 'Fezcodex' ,
111+ ogDescription : post ? post . body . substring ( 0 , 150 ) : '' ,
112+ ogImage : post ?. attributes ?. ogImage || post ?. attributes ?. image || '/images/asset/ogtitle.png' ,
113+ twitterCard : 'summary_large_image' ,
114+ twitterTitle : post ? `${ post . attributes . title } | Fezcodex` : 'Fezcodex' ,
115+ twitterDescription : post ? post . body . substring ( 0 , 150 ) : '' ,
116+ twitterImage : post ?. attributes ?. ogImage || post ?. attributes ?. image || '/images/asset/ogtitle.png' ,
117+ } ) ;
118+
106119 useEffect ( ( ) => {
107120 setHasTrackedRead ( false ) ;
108121 } , [ currentSlug ] ) ;
@@ -334,49 +347,9 @@ const DossierBlogPostPage = () => {
334347 const prevPost = post . seriesPosts ?. [ currentPostIndex + 1 ] ;
335348 const nextPost = post . seriesPosts ?. [ currentPostIndex - 1 ] ;
336349
337- return (
338-
339- < div className = "min-h-screen bg-[#f3f3f3] text-[#111] overflow-y-auto selection:bg-black selection:text-white custom-scrollbar font-sans relative" >
340-
341- < Seo
342-
343- title = { `${ post . attributes . title } | Fezcodex Archive` }
344-
345- description = { post . body . substring ( 0 , 150 ) }
346-
347- keywords = { post . attributes . tags ? post . attributes . tags . join ( ', ' ) : '' }
348-
349- ogTitle = { `${ post . attributes . title } | Fezcodex` }
350-
351- ogDescription = { post . body . substring ( 0 , 150 ) }
352-
353- ogImage = {
354-
355- post . attributes . ogImage ||
356-
357- post . attributes . image ||
358-
359- '/images/asset/ogtitle.png'
360-
361- }
362-
363- twitterCard = "summary_large_image"
364-
365- twitterTitle = { `${ post . attributes . title } | Fezcodex` }
366-
367- twitterDescription = { post . body . substring ( 0 , 150 ) }
368-
369- twitterImage = {
370-
371- post . attributes . ogImage ||
372-
373- post . attributes . image ||
374-
375- '/images/asset/ogtitle.png'
376-
377- }
350+ return (
378351
379- / >
352+ < div className = "min-h-screen bg-[#f3f3f3] text-[#111] overflow-y-auto selection:bg-black selection:text-white custom-scrollbar font-sans relative" >
380353
381354 < GrainOverlay />
382355 < CoffeeStain />
0 commit comments