Skip to content

Commit e972294

Browse files
committed
use from profile data
Signed-off-by: rishichawda <[email protected]>
1 parent 3b6b397 commit e972294

File tree

3 files changed

+52
-37
lines changed

3 files changed

+52
-37
lines changed

src/pages/articles/series.astro

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@ import { Image } from "astro:assets";
55
import { Schema } from "astro-seo-schema";
66
import { isPartOfSeries, getAllSeries } from "../../utils/seriesUtils";
77
import SeriesIndicator from "../../components/article/series_indicator.astro";
8-
import siteMetadata from "../../../metadata";
8+
9+
interface Social { platform: string; url: string; }
10+
interface ProfileData { name: string; socials: Social[]; }
11+
12+
const profileEntry = await getCollection("profile");
13+
const profile = profileEntry[0].data as ProfileData;
914
1015
const page_info = {
11-
title: "Article Series | Rishi Chawda",
16+
title: `Article Series | ${profile.name}`,
1217
description: "Explore multi-part article series covering in-depth topics in web development, React architecture, SEO, and more.",
1318
keywords: "article series, multi-part articles, web development tutorials, React architecture, SEO guides",
1419
};
@@ -49,14 +54,14 @@ const pageUrl = new URL(
4954
item={{
5055
"@context": "https://schema.org",
5156
"@type": "CollectionPage",
52-
name: "Article Series by Rishi Chawda",
57+
name: `Article Series by ${profile.name}`,
5358
description: page_info.description,
5459
url: pageUrl,
5560
author: {
5661
"@type": "Person",
57-
name: siteMetadata.schema.author.name,
58-
url: siteMetadata.schema.author.url,
59-
sameAs: siteMetadata.schema.author.sameAs
62+
name: profile.name,
63+
url: "https://rishikc.com",
64+
sameAs: profile.socials.map((social: Social) => social.url)
6065
},
6166
inLanguage: "en-US",
6267
dateCreated: allSeries.length > 0 ? allSeries[allSeries.length - 1].articles[0].data.date.toISOString() : undefined,
@@ -73,13 +78,13 @@ const pageUrl = new URL(
7378
description: `A ${series.totalParts}-part series on ${series.seriesTitle.toLowerCase()} covering in-depth topics in web development and engineering.`,
7479
author: {
7580
"@type": "Person",
76-
name: siteMetadata.schema.author.name,
77-
url: siteMetadata.schema.author.url
81+
name: profile.name,
82+
url: "https://rishikc.com"
7883
},
7984
publisher: {
8085
"@type": "Person",
81-
name: siteMetadata.schema.author.name,
82-
url: siteMetadata.schema.author.url
86+
name: profile.name,
87+
url: "https://rishikc.com"
8388
},
8489
inLanguage: "en-US",
8590
startDate: series.articles[0].data.date.toISOString(),
@@ -96,13 +101,13 @@ const pageUrl = new URL(
96101
dateModified: article.data.date.toISOString(),
97102
author: {
98103
"@type": "Person",
99-
name: siteMetadata.schema.author.name,
100-
url: siteMetadata.schema.author.url
104+
name: profile.name,
105+
url: "https://rishikc.com"
101106
},
102107
publisher: {
103108
"@type": "Person",
104-
name: siteMetadata.schema.author.name,
105-
url: siteMetadata.schema.author.url
109+
name: profile.name,
110+
url: "https://rishikc.com"
106111
},
107112
inLanguage: "en-US",
108113
keywords: (article.data.tags || []).join(", "),

src/pages/index.astro

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,20 @@ import "../styles/global.css";
77
import BaseLayout from "../layouts/base_layout.astro";
88
import { Schema } from "astro-seo-schema";
99
import favicon from "../../content/assets/logo/logo.png";
10+
import { getCollection } from "astro:content";
11+
12+
interface Social { platform: string; url: string; }
13+
interface Position { title: string; }
14+
interface Experience { company: string; positions: Position[]; }
15+
interface ProfileData { name: string; title: string; summary: string; experience: Experience[]; socials: Social[]; }
16+
17+
const profileEntry = await getCollection("profile");
18+
const profile = profileEntry[0].data as ProfileData;
1019
1120
const page_info = {
12-
title: "Rishi Chawda - Software Engineer",
13-
description: "Rishi Chawda - Software Engineer",
14-
keywords: "Rishi Chawda - Software Engineer",
21+
title: `${profile.name} - ${profile.title}`,
22+
description: `${profile.name} - ${profile.title}`,
23+
keywords: `${profile.name} - ${profile.title}`,
1524
};
1625
1726
const siteUrl = new URL(
@@ -26,23 +35,16 @@ const siteUrl = new URL(
2635
item={{
2736
"@context": "https://schema.org",
2837
"@type": "Person",
29-
name: "Rishi Chawda",
30-
jobTitle: "Senior Software Engineer",
38+
name: profile.name,
39+
jobTitle: profile.title,
3140
worksFor: {
3241
"@type": "Organization",
33-
name: "Progress Chef",
42+
name: profile.experience[0]?.company || "Unknown Company",
3443
},
3544
url: siteUrl,
3645
image: `${siteUrl.replace(/\/$/, "")}/${favicon.src}`,
37-
description:
38-
"Senior Software Engineer building systems with Software Engineering and DevSecOps skills",
39-
sameAs: [
40-
"https://github.com/rishichawda",
41-
"https://www.linkedin.com/in/rkrishi",
42-
"https://www.instagram.com/rishiikc",
43-
"https://twitter.com/rishiikc",
44-
"https://dribbble.com/rishikc",
45-
],
46+
description: profile.summary,
47+
sameAs: profile.socials.map((social: Social) => social.url),
4648
}}
4749
/>
4850
<main>

src/pages/projects.astro

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ interface OpenSourceContribution {
4343
topics?: string[];
4444
}
4545
46+
interface Social { platform: string; url: string; }
47+
interface Position { title: string; }
48+
interface Experience { company: string; positions: Position[]; }
49+
interface ProfileData { name: string; title: string; summary: string; experience: Experience[]; socials: Social[]; }
50+
4651
// Get projects from content collection
4752
const projectsCollection = await getCollection("projects");
4853
@@ -52,17 +57,21 @@ const openSourceContributions: OpenSourceContribution[] =
5257
5358
const openSourceContributionsStats = projectsCollection[2].data;
5459
60+
// Get profile data
61+
const profileEntry = await getCollection("profile");
62+
const profile = profileEntry[0].data as ProfileData;
63+
5564
const featuredProjects = projects.filter((project) => project.featured);
5665
const otherProjects = projects.filter((project) => !project.featured);
5766
5867
const categories = [...new Set(projects.map((p) => p.category))];
5968
6069
const page_info = {
61-
title: "Projects | Rishi Chawda",
70+
title: `Projects | ${profile.name}`,
6271
description:
63-
"Explore Rishi Chawda's development projects including React Native components, web applications, developer tools, and open source contributions.",
72+
`Explore ${profile.name}'s development projects including React Native components, web applications, developer tools, and open source contributions.`,
6473
keywords:
65-
"Rishi Chawda, Projects, Open Source, React Native, React, TypeScript, JavaScript, Web Development, Mobile Development, Developer Tools",
74+
`${profile.name}, Projects, Open Source, React Native, React, TypeScript, JavaScript, Web Development, Mobile Development, Developer Tools`,
6675
};
6776
6877
const siteUrl = new URL(
@@ -77,16 +86,15 @@ const siteUrl = new URL(
7786
item={{
7887
"@context": "https://schema.org",
7988
"@type": "Person",
80-
name: "Rishi Chawda",
81-
jobTitle: "Senior Software Engineer",
89+
name: profile.name,
90+
jobTitle: profile.title,
8291
worksFor: {
8392
"@type": "Organization",
84-
name: "Progress Chef",
93+
name: profile.experience[0]?.company || "Unknown Company",
8594
},
8695
url: siteUrl,
8796
image: `${siteUrl.replace(/\/$/, "")}/${favicon.src}`,
88-
description:
89-
"Senior Software Engineer's development projects and open source contributions",
97+
description: profile.summary,
9098
}}
9199
/>
92100

0 commit comments

Comments
 (0)