diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index 8cc8f1b9a..e8a7a2b7e 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -21,6 +21,8 @@ export interface Props { initialLoadingMessage?: string; permalink?: string; jsonLd?: Record[]; + categoryLevel0?: string; + categoryLevel1?: string; } const { @@ -34,6 +36,8 @@ const { jsonLd = [], redirectUrl = '', initialLoadingMessage = '', + categoryLevel0 = '', + categoryLevel1 = '', } = Astro.props; // Remove trailing slashes to consider the page as canonical @@ -156,6 +160,10 @@ const gaPageIdentifier = Astro.url.pathname client:load /> + + { categoryLevel0 && } + { categoryLevel1 && } + diff --git a/src/pages/[roadmapId]/[...topicId].astro b/src/pages/[roadmapId]/[...topicId].astro index 1e686a5c1..46b57b389 100644 --- a/src/pages/[roadmapId]/[...topicId].astro +++ b/src/pages/[roadmapId]/[...topicId].astro @@ -2,7 +2,7 @@ import Breadcrumbs from '../../components/Breadcrumbs.astro'; import RoadmapBanner from '../../components/RoadmapBanner.astro'; import BaseLayout from '../../layouts/BaseLayout.astro'; -import { getRoadmapTopicFiles, RoadmapTopicFileType } from '../../lib/roadmap-topic'; +import { getRoadmapTopicFiles,RoadmapTopicFileType } from '../../lib/roadmap-topic'; export async function getStaticPaths() { const topicPathMapping = await getRoadmapTopicFiles(); @@ -31,6 +31,8 @@ const { file, breadcrumbs, roadmapId, roadmap, heading } = Astro.props as Roadma description={`Free resources to learn ${heading} in ${roadmap.briefTitle}. Everything you need to know about ${heading} and how it relates to ${roadmap.briefTitle}.`} noIndex={true} permalink={`/${roadmapId}/${topicId}`} + categoryLevel0={roadmap.briefTitle} + categoryLevel1={heading} >
diff --git a/src/pages/[roadmapId]/index.astro b/src/pages/[roadmapId]/index.astro index 943d6107a..476ff48a4 100644 --- a/src/pages/[roadmapId]/index.astro +++ b/src/pages/[roadmapId]/index.astro @@ -61,11 +61,13 @@ const contentContributionLink = `https://github.com/kamranahmedse/developer-road
diff --git a/src/pages/best-practices/[bestPracticeId]/index.astro b/src/pages/best-practices/[bestPracticeId]/index.astro index 06addbc36..4ff96a6cb 100644 --- a/src/pages/best-practices/[bestPracticeId]/index.astro +++ b/src/pages/best-practices/[bestPracticeId]/index.astro @@ -58,6 +58,8 @@ const contentContributionLink = `https://github.com/kamranahmedse/developer-road keywords={bestPracticeData.seo.keywords} noIndex={bestPracticeData.isUpcoming} jsonLd={jsonLdSchema} + categoryLevel0={"Best Practices"} + categoryLevel1={bestPracticeData.briefTitle} > diff --git a/src/pages/videos/[videoId].astro b/src/pages/videos/[videoId].astro index 75c68722b..a350eaafb 100644 --- a/src/pages/videos/[videoId].astro +++ b/src/pages/videos/[videoId].astro @@ -1,7 +1,7 @@ --- import VideoHeader from '../../components/VideoHeader.astro'; import BaseLayout from '../../layouts/BaseLayout.astro'; -import { getAllVideos, VideoFileType } from '../../lib/video'; +import { getAllVideos,VideoFileType } from '../../lib/video'; export interface Props { video: VideoFileType; @@ -24,6 +24,8 @@ const { video } = Astro.props; title={video.frontmatter.title} description={video.frontmatter.description} permalink={`/videos/${videoId}`} + categoryLevel0={"Videos"} + categoryLevel1={video.frontmatter.title} >