1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-08-29 20:21:50 +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; isNew: boolean;
type: 'visual' | 'textual'; type: 'visual' | 'textual';
ogImageUrl?: string;
date: string; date: string;
sitemap: { sitemap: {
priority: number; priority: number;

View File

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

View File

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

View File

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

View File

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