Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/[article]/[year]/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default async function ArticlePage({ params }: PageProps) {
const articleYear = article.year;

if (articleYear !== year) {
redirect(`/articles/${articleYear}/${article.slug}`);
redirect(URLS.ARTICLES(articleYear, article.slug));
}

return (
Expand Down
4 changes: 2 additions & 2 deletions src/app/[article]/category/[category]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ export default async function CategoryArticlePage({ params }: PageProps) {
{category} {articleLabel}
</h3>
<div className="list-container">
{filteredArticles.map((article, index) => (
<ArticleSummaryCard key={index} article={article} />
{filteredArticles.map((article) => (
<ArticleSummaryCard key={article.slug} article={article} />
))}
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/app/[article]/tag/[tag]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ export default async function TagArticlePage({ params }: PageProps) {
</h3>
</div>
<div className="list-container">
{filteredArticles.map((article, index) => (
<ArticleSummaryCard key={index} article={article} />
{filteredArticles.map((article) => (
<ArticleSummaryCard key={article.slug} article={article} />
))}
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/app/education/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ export default function EducationPage() {
</Breadcrumb>
<h3>Education</h3>
<div className="grid grid-cols-1 gap-8">
{education.map((edu, index) => (
<EducationSummaryCard key={index} education={edu} />
{education.map((edu) => (
<EducationSummaryCard key={edu.slug} education={edu} />
))}
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/app/projects/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ export default async function ProjectPage({ params }: PageProps) {
subtitle={project.description}
/>
<div className="flex flex-wrap gap-2">
{project.stack.map((tag, index) => (
{project.stack.map((tag) => (
<TagButton
key={index}
key={tag}
tag={tag}
source="projects"
asLink
Expand Down Expand Up @@ -137,7 +137,7 @@ export async function generateMetadata({
title: `${project.title}`,
description: project.description,
url: URLS.PROJECTS(project.slug),
image: project.ogImage,
image: project.ogImage || project.image,
});

return metadata;
Expand Down
4 changes: 2 additions & 2 deletions src/app/projects/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export default function ProjectsPage() {
</Breadcrumb>
<h3>Projects</h3>
<div className="grid grid-cols-1 md:grid-cols-2 gap-8">
{projects.map((project, index) => (
<ProjectSummaryCard key={index} project={project} />
{projects.map((project) => (
<ProjectSummaryCard key={project.slug} project={project} />
))}
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/app/projects/stack/[tag]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ export default async function TagProjectsPage({ params }: PageProps) {
<h3>{tag} projects</h3>
</div>
<div className="grid grid-cols-1 md:grid-cols-2 gap-8">
{filteredProjects.map((project, index) => (
<ProjectSummaryCard key={index} project={project} />
{filteredProjects.map((project) => (
<ProjectSummaryCard key={project.slug} project={project} />
))}
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/app/work/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export default function WorkPage() {
</Breadcrumb>
<h3>Work Experience</h3>
<div className="grid grid-cols-1 gap-8">
{work.map((experience, index) => (
<WorkSummaryCard key={index} experience={experience} />
{work.map((experience) => (
<WorkSummaryCard key={experience.slug} experience={experience} />
))}
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/components/helpers/structured-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export function generateArticleSchema(article: Article) {
url: configData.seo.image,
},
},
url: URLS.ARTICLES(year, article.slug),
url: `${BASE_URL}${URLS.ARTICLES(year, article.slug)}`,
wordCount: article.content?.split(" ").length || 0,
timeRequired: `PT${Math.max(1, Math.ceil((article.content?.split(" ").length || 0) / 200))}M`,
keywords: article.tags.join(", "),
Expand Down Expand Up @@ -113,7 +113,7 @@ export function generateCommunitySchema(
name: PROFILE_NAME,
url: BASE_URL,
},
url: URLS.COMMUNITY(year, community.slug),
url: `${BASE_URL}${URLS.COMMUNITY(year, community.slug)}`,
eventStatus: "https://schema.org/EventScheduled",
eventAttendanceMode: "https://schema.org/OfflineEventAttendanceMode",
about: community.description,
Expand Down Expand Up @@ -149,7 +149,7 @@ export function generateProjectSchema(project: Project) {
"@type": "SoftwareApplication",
name: project.title,
description: project.description,
url: project.url || URLS.PROJECTS(project.slug),
url: project.url || `${BASE_URL}${URLS.PROJECTS(project.slug)}`,
image: project.image,
author: {
"@type": "Person",
Expand Down
4 changes: 2 additions & 2 deletions src/components/helpers/work.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export function getWorkBySlugRaw(
if (!match) return null;

const raw = fs.readFileSync(match, "utf-8");
const { data } = matter(raw);
const { data, content } = matter(raw);
const parsed = WorkExperienceSchema.safeParse(data);

if (!parsed.success) return null;
Expand All @@ -193,7 +193,7 @@ export function getWorkBySlugRaw(
}),
};

return { meta, raw };
return { meta, raw: content };
}

export function getWorkBySlugContent(
Expand Down
Loading