diff --git a/next.config.js b/next.config.js index b97848d..074b341 100644 --- a/next.config.js +++ b/next.config.js @@ -39,6 +39,15 @@ const nextConfig = { }, staticPageGenerationTimeout: 600, + + async rewrites() { + return [ + { + source: '/downloads/cv.pdf', + destination: '/api/cv.pdf', + }, + ]; + }, }; module.exports = nextConfig; diff --git a/src/app/(public)/about/page.tsx b/src/app/(public)/about/page.tsx index 43b02a1..383681e 100644 --- a/src/app/(public)/about/page.tsx +++ b/src/app/(public)/about/page.tsx @@ -109,7 +109,7 @@ const AboutFreeTimePage = async () => {
-

Free Time

+

About me

diff --git a/src/app/(public)/cv/cv/page.tsx b/src/app/(public)/cv/cv/page.tsx deleted file mode 100644 index c6f5f93..0000000 --- a/src/app/(public)/cv/cv/page.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import * as React from 'react'; - -import CvCard from '@/components/organisms/cv/CvCard'; - -export const metadata = { - title: 'CV | MartaCodes.it', - description: 'CV page', -}; - -const CVPage = async () => { - return ( -

-
-
-

CV

- - -
-
-
- ); -}; - -export default CVPage; diff --git a/src/app/(public)/cv/page.tsx b/src/app/(public)/cv/page.tsx index 99a1ac6..09c71f2 100644 --- a/src/app/(public)/cv/page.tsx +++ b/src/app/(public)/cv/page.tsx @@ -8,6 +8,7 @@ import Intro from '@/components/organisms/about-work/Intro'; import Languages from '@/components/organisms/about-work/Languages'; import Publications from '@/components/organisms/about-work/Publications'; import WorkExperience from '@/components/organisms/about-work/WorkExperience'; +import CvCard from '@/components/organisms/cv/CvCard'; import { queryJobs } from '@/queries/jobs'; import { queryLanguages } from '@/queries/languages'; @@ -99,6 +100,10 @@ const AboutPage = async () => {
+ +
+ +
diff --git a/src/components/organisms/cv/CvCard.tsx b/src/components/organisms/cv/CvCard.tsx index 7a2197e..1babe6d 100644 --- a/src/components/organisms/cv/CvCard.tsx +++ b/src/components/organisms/cv/CvCard.tsx @@ -1,6 +1,5 @@ 'use client'; -import Image from 'next/image'; import * as React from 'react'; import { useTranslation } from 'react-i18next'; import { FaDownload } from 'react-icons/fa'; @@ -10,38 +9,15 @@ import Button from '@/components/buttons/Button'; const CvCard = () => { const { t } = useTranslation(); - const width = 1200; - return ( - <> -
- - - -
- -
- CV Page 1 - CV Page 2 -
- +
+ + + +
); }; diff --git a/src/data/locales/en.json b/src/data/locales/en.json index 65489c9..0b191e1 100644 --- a/src/data/locales/en.json +++ b/src/data/locales/en.json @@ -43,7 +43,9 @@ "icon": "https://res.cloudinary.com/dwrurydlt/image/upload/v1692894192/newspaper_e15ec94d21.svg" } }, - "aboutFreeTime": {}, + "about": { + "title": "Su di me" + }, "projects": { "readMore": "Read More" }, diff --git a/src/data/locales/it.json b/src/data/locales/it.json index a4faca4..cd347b2 100644 --- a/src/data/locales/it.json +++ b/src/data/locales/it.json @@ -40,12 +40,15 @@ "publications": { "title": "Pubblicazioni", "icon": "https://res.cloudinary.com/dwrurydlt/image/upload/v1692894192/newspaper_e15ec94d21.svg" - }, - "projects": { - "readMore": "Leggi di più" - }, - "cv": { - "download": "Scarica PDF" } + }, + "about": { + "title": "About me" + }, + "projects": { + "readMore": "Leggi di più" + }, + "cv": { + "download": "Scarica PDF" } } diff --git a/src/pages/api/cv.pdf.ts b/src/pages/api/cv.pdf.ts new file mode 100644 index 0000000..dd90425 --- /dev/null +++ b/src/pages/api/cv.pdf.ts @@ -0,0 +1,32 @@ +/* eslint-disable no-console */ +import { NextApiRequest, NextApiResponse } from 'next'; +import fetch from 'node-fetch'; + +export default async function handler( + req: NextApiRequest, + res: NextApiResponse, +) { + try { + const cloudinaryUrl = + 'https://res.cloudinary.com/dwrurydlt/image/upload/v1694634540/Pancaldi_CV_aug23_258811b6b1.pdf'; + + const cloudinaryResponse = await fetch(cloudinaryUrl); + + if (!cloudinaryResponse.ok) { + console.error( + 'Error fetching the PDF from Cloudinary:', + cloudinaryResponse.statusText, + ); + res.status(500).end('Internal Server Error'); + return; + } + + res.setHeader('Content-Type', 'application/pdf'); + res.setHeader('Content-Disposition', 'inline; filename=cv.pdf'); + + cloudinaryResponse.body.pipe(res); + } catch (error) { + console.error('Error:', error); + res.status(500).end('Internal Server Error'); + } +}