11import { FALLBACK_LOCALE , Locales } from '@/app/i18n/settings' ;
2- import { EntryFieldTypes } from 'contentful' ;
32import dompurify from 'isomorphic-dompurify' ;
43import type { Metadata , NextPage } from 'next' ;
54import dynamicImport from 'next/dynamic' ;
65import AboutMeHero from '../../components/AboutMeHero' ;
76import NextLink from '../../components/basic/NextLink' ;
87import { newCommonMetaTags } from '../../frontend-utils/meta-tags' ;
9- import type { StaticContent } from '../../models/static-content' ;
10- import { client , getBlurringImage } from '../../utils/contentful.utils' ;
11- import { mapLocale } from '../i18n/map-locale.util' ;
8+ import { getBlurringImage } from '../../utils/contentful.utils' ;
9+ import { aboutMeData } from '@/models/static-content' ;
1210
1311const TechStackCarousel = dynamicImport (
1412 ( ) => import ( '../../components/TechStackCarousel' ) ,
@@ -23,7 +21,7 @@ export async function generateMetadata(): Promise<Metadata> {
2321
2422const AboutMePage : NextPage = async ( ) => {
2523 const {
26- props : { aboutMeDetails, img, svg, techStacks } ,
24+ props : { aboutMeDetails, img, svg} ,
2725 } = await getStaticProps ( ) ;
2826 return (
2927 < >
@@ -49,24 +47,6 @@ const AboutMePage: NextPage = async () => {
4947 } ) }
5048 </ article >
5149
52- < h2 className = "text-center" > This website is powered by</ h2 >
53- < TechStackCarousel techStacks = { techStacks } />
54-
55- < section className = "mb-2 mt-4" >
56- < h4 className = "text-center" >
57- This awesome carousel is easily made using
58- < NextLink
59- href = "https://github.com/leandrowd/react-responsive-carousel"
60- target = "_blank"
61- aria-label = "React Responsive Carousel"
62- rel = "noreferrer"
63- className = "text-primary-900 dark:text-primary-300"
64- >
65- React Responsive Carousel
66- </ NextLink >
67- .
68- </ h4 >
69- </ section >
7050 < section className = "pb-8" >
7151 < h4 className = "text-center" >
7252 Here is the link to my
@@ -86,45 +66,15 @@ const AboutMePage: NextPage = async () => {
8666 ) ;
8767} ;
8868
89- type StaticAssetSkeleton = {
90- contentTypeId : 'staticText' ;
91- fields : {
92- key : EntryFieldTypes . Text ;
93- content : EntryFieldTypes . Text ;
94- category : EntryFieldTypes . Text ;
95- label : EntryFieldTypes . Text ;
96- order : EntryFieldTypes . Number ;
97- } ;
98- } ;
99-
10069const getStaticProps = async ( ) => {
101- const entries = await client . getEntries < StaticAssetSkeleton , Locales > ( {
102- content_type : 'staticText' ,
103- 'fields.category' : 'about_me' ,
104- order : [ 'fields.order' ] ,
105- locale : mapLocale ( FALLBACK_LOCALE ) ,
106- } ) ;
70+ // Use local about me data instead of Contentful
71+ const aboutMeDetails = aboutMeData . sort ( ( a , b ) => a . order - b . order ) ;
10772
10873 const { img, svg} = await getBlurringImage ( 'batman_cover.png' ) ;
10974
110- const assets = await client . getAssets < Locales > ( {
111- 'fields.title[in]' : [
112- 'React,TypeScript,NextJS,Prettier,ESLint,Emotion,Supabase,GitHub,Vercel' ,
113- ] ,
114- } ) ;
115-
116- const techStacks = assets . items . map ( asset => ( {
117- ...asset ,
118- name : asset . fields . title as string ,
119- url : asset . fields . file ?. url as string ,
120- } ) ) ;
121-
12275 return {
12376 props : {
124- aboutMeDetails : entries . items . map (
125- entry => entry . fields ,
126- ) as StaticContent [ ] ,
127- techStacks,
77+ aboutMeDetails,
12878 img,
12979 svg,
13080 } ,
0 commit comments