1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-08-29 12:10:22 +02:00

Implement og image override and fix canonical urls

This commit is contained in:
Kamran Ahmed
2024-04-26 00:45:08 +01:00
parent 3a1b896eb2
commit f173220966
5 changed files with 10 additions and 7 deletions

View File

@@ -14,6 +14,7 @@ export interface GuideFrontmatter {
};
isNew: boolean;
type: 'visual' | 'textual';
ogImageUrl?: string;
date: string;
sitemap: {
priority: number;

View File

@@ -19,7 +19,7 @@ const ogImageUrl = getOpenGraphImageUrl({
<BaseLayout
title={guideData.seo.title}
description={guideData.seo.description}
permalink={`/backend/${guideId}`}
permalink={`/backend/developer-skills`}
canonicalUrl={guideData.canonicalUrl}
ogImageUrl={ogImageUrl}
>

View File

@@ -19,7 +19,7 @@ const ogImageUrl = getOpenGraphImageUrl({
<BaseLayout
title={guideData.seo.title}
description={guideData.seo.description}
permalink={`/backend/${guideId}`}
permalink={`/backend/developer-tools`}
canonicalUrl={guideData.canonicalUrl}
ogImageUrl={ogImageUrl}
>

View File

@@ -22,7 +22,7 @@ const ogImageUrl = getOpenGraphImageUrl({
<BaseLayout
title={guideData.seo.title}
description={guideData.seo.description}
permalink={`/backend/${guideId}`}
permalink={`/backend/languages`}
canonicalUrl={guideData.canonicalUrl}
ogImageUrl={ogImageUrl}
>

View File

@@ -24,10 +24,12 @@ const { guideId } = Astro.params;
const { guide } = Astro.props;
const { frontmatter: guideData, author } = guide;
const ogImageUrl = getOpenGraphImageUrl({
const ogImageUrl =
guideData.ogImageUrl ||
getOpenGraphImageUrl({
group: 'guides',
resourceId: guideId,
});
});
---
<BaseLayout