diff --git a/src/components/seoHeader/SeoHeader.js b/src/components/seoHeader/SeoHeader.js index ab0516306011f..a7eb895d1b8aa 100644 --- a/src/components/seoHeader/SeoHeader.js +++ b/src/components/seoHeader/SeoHeader.js @@ -1,8 +1,65 @@ import React from "react"; import { Helmet } from "react-helmet"; -import { seo } from "../../portfolio.js"; +import { + greeting, + seo, + socialMediaLinks, + experience, + contactPageData, + certifications, +} from "../../portfolio.js"; function SeoHeader() { + let sameAs = []; + socialMediaLinks + .filter( + (media) => + !(media.link.startsWith("tel") || media.link.startsWith("mailto")) + ) + .forEach((media) => { + sameAs.push(media.link); + }); + + let mail = socialMediaLinks + .find((media) => media.link.startsWith("mailto")) + .link.substring("mailto:".length); + let job = experience.sections + ?.find((section) => section.work) + ?.experiences?.at(0); + + let credentials = []; + certifications.certifications.forEach((certification) => { + credentials.push({ + "@context": "https://schema.org", + "@type": "EducationalOccupationalCredential", + url: certification.certificate_link, + name: certification.title, + description: certification.subtitle, + }); + }); + const data = { + "@context": "https://schema.org/", + "@type": "Person", + name: greeting.title, + url: seo?.og?.url, + email: mail, + telephone: contactPageData.phoneSection?.subtitle, + sameAs: sameAs, + jobTitle: job.title, + worksFor: { + "@type": "Organization", + name: job.company, + }, + address: { + "@type": "PostalAddress", + addressLocality: contactPageData.addressSection?.locality, + addressRegion: contactPageData.addressSection?.region, + addressCountry: contactPageData.addressSection?.country, + postalCode: contactPageData.addressSection?.postalCode, + streetAddress: contactPageData.addressSection?.streetAddress, + }, + hasCredential: credentials, + }; return ( {seo.title} @@ -10,6 +67,7 @@ function SeoHeader() { + ); } diff --git a/src/portfolio.js b/src/portfolio.js index 1e67c14e7c182..f427eddf958a3 100644 --- a/src/portfolio.js +++ b/src/portfolio.js @@ -531,6 +531,7 @@ const experience = { sections: [ { title: "Work", + work: true, experiences: [ { title: "Associate AI Engineer", @@ -749,6 +750,11 @@ const contactPageData = { title: "Address", subtitle: "Ambavadi vas, Kanodar, T.A.-Palanpur, Dist.-Banaskantha, Gujarat - 385520", + locality: "Kanodar", + country: "IN", + region: "Gujarat", + postalCode: "385520", + streetAddress: "Ambavadi vas", avatar_image_path: "address_image.svg", location_map_link: "https://goo.gl/maps/MpMqtRZytFchMkZ76", },