Add support for replacing TNS partner banner

pull/8446/head
Kamran Ahmed 3 weeks ago
parent f3eed4d010
commit 45059998c0
  1. 1
      src/components/CustomRoadmap/RoadmapHeader.tsx
  2. 33
      src/components/CustomRoadmap/RoadmapHint.tsx
  3. 18
      src/components/RoadmapHeader.astro
  4. 4
      src/components/RoadmapHint.astro
  5. 5
      src/data/roadmaps/backend/backend.md
  6. 5
      src/data/roadmaps/devops/devops.md
  7. 4
      src/data/roadmaps/engineering-manager/engineering-manager.md
  8. 5
      src/data/roadmaps/frontend/frontend.md
  9. 5
      src/data/roadmaps/kubernetes/kubernetes.md
  10. 4
      src/data/roadmaps/product-manager/product-manager.md
  11. 4
      src/data/roadmaps/software-architect/software-architect.md
  12. 6
      src/lib/roadmap.ts
  13. 2
      src/pages/[roadmapId]/courses.astro
  14. 2
      src/pages/[roadmapId]/index.astro
  15. 2
      src/pages/[roadmapId]/projects.astro

@ -196,7 +196,6 @@ export function RoadmapHeader(props: RoadmapHeaderProps) {
<RoadmapHint <RoadmapHint
roadmapTitle={title!} roadmapTitle={title!}
hasTNSBanner={false}
roadmapId={roadmapId!} roadmapId={roadmapId!}
/> />
</div> </div>

@ -4,42 +4,19 @@ import { ResourceProgressStats } from './ResourceProgressStats';
type RoadmapHintProps = { type RoadmapHintProps = {
roadmapId: string; roadmapId: string;
roadmapTitle: string; roadmapTitle: string;
hasTNSBanner?: boolean;
tnsBannerLink?: string;
}; };
export function RoadmapHint(props: RoadmapHintProps) { export function RoadmapHint(props: RoadmapHintProps) {
const { const { roadmapTitle, roadmapId } = props;
roadmapTitle,
roadmapId,
hasTNSBanner = false,
tnsBannerLink = '',
} = props;
return ( return (
<div <div
className={cn('mb-0 mt-4 rounded-md border-0 sm:mt-7 sm:border', { className={cn(
'sm:-mb-[82px]': hasTNSBanner, 'mb-0 mt-4 rounded-md border-0 sm:-mb-[65px] sm:mt-7 sm:border',
'sm:-mb-[65px]': !hasTNSBanner,
})}
>
{hasTNSBanner && (
<div className="hidden border-b bg-gray-100 px-2 py-1.5 sm:block">
<p className="text-sm">
Get the latest {roadmapTitle} news from our sister site{' '}
<a
href={tnsBannerLink}
target="_blank"
className="font-semibold underline"
>
TheNewStack.io
</a>
</p>
</div>
)} )}
>
<ResourceProgressStats <ResourceProgressStats
isSecondaryBanner={hasTNSBanner} isSecondaryBanner={false}
resourceId={roadmapId} resourceId={roadmapId}
resourceType="roadmap" resourceType="roadmap"
/> />

@ -18,7 +18,11 @@ export interface Props {
title: string; title: string;
description: string; description: string;
note?: string; note?: string;
tnsBannerLink?: string; partner?: {
description: string;
link: string;
linkText: string;
};
roadmapId: string; roadmapId: string;
isUpcoming?: boolean; isUpcoming?: boolean;
hasSearch?: boolean; hasSearch?: boolean;
@ -26,14 +30,14 @@ export interface Props {
question?: RoadmapFrontmatter['question']; question?: RoadmapFrontmatter['question'];
hasTopics?: boolean; hasTopics?: boolean;
isForkable?: boolean; isForkable?: boolean;
activeTab?: 'roadmap' | 'projects'; activeTab?: 'roadmap' | 'projects' | 'courses';
} }
const { const {
title, title,
description, description,
roadmapId, roadmapId,
tnsBannerLink, partner,
isUpcoming = false, isUpcoming = false,
note, note,
hasTopics = false, hasTopics = false,
@ -53,13 +57,13 @@ const roadmapTitle =
<div class='container mt-0 flex flex-col gap-2.5 px-0 sm:mt-3 sm:px-4'> <div class='container mt-0 flex flex-col gap-2.5 px-0 sm:mt-3 sm:px-4'>
{ {
tnsBannerLink && ( partner && (
<div class='hidden rounded-md border bg-white px-2 py-1.5 sm:block'> <div class='hidden rounded-md border bg-white px-2 py-1.5 sm:block'>
<p class='py-0.5 text-left text-sm'> <p class='py-0.5 text-left text-sm'>
<span class='badge mr-1'>Partner</span> <span class='badge mr-1'>Partner</span>
Get the latest {roadmapTitle} news from our sister site{' '} {partner.description}
<a href={tnsBannerLink} target='_blank' class='font-medium underline'> <a href={partner.link} target='_blank' class='font-medium underline'>
TheNewStack.io {partner.linkText}
</a> </a>
</p> </p>
</div> </div>

@ -5,13 +5,11 @@ import ResourceProgressStats from './ResourceProgressStats.astro';
export interface Props { export interface Props {
roadmapId: string; roadmapId: string;
tnsBannerLink?: string;
titleQuestion?: string; titleQuestion?: string;
titleAnswer?: string; titleAnswer?: string;
} }
const { roadmapId, tnsBannerLink } = Astro.props; const { roadmapId } = Astro.props;
const hasTnsBanner = !!tnsBannerLink;
--- ---
<div class:list={['mb-0 rounded-md border mt-2 bg-white']}> <div class:list={['mb-0 rounded-md border mt-2 bg-white']}>

@ -9,7 +9,10 @@ title: 'Backend Developer'
description: 'Step by step guide to becoming a modern backend developer in 2025' description: 'Step by step guide to becoming a modern backend developer in 2025'
hasTopics: true hasTopics: true
isForkable: false isForkable: false
tnsBannerLink: 'https://thenewstack.io?utm_source=roadmap.sh&utm_medium=Referral&utm_campaign=Alert' partner:
description: "Get the latest Backend news from our sister site"
link: "https://thenewstack.io/?utm_source=roadmap.sh&utm_medium=Referral&utm_campaign=Alert"
linkText: "TheNewStack.io"
question: question:
title: 'What is Backend Development?' title: 'What is Backend Development?'
description: | description: |

@ -9,7 +9,10 @@ title: 'DevOps Roadmap'
description: 'Step by step guide for DevOps, SRE or any other Operations Role in 2025' description: 'Step by step guide for DevOps, SRE or any other Operations Role in 2025'
hasTopics: true hasTopics: true
isForkable: false isForkable: false
tnsBannerLink: 'https://thenewstack.io?utm_source=roadmap.sh&utm_medium=Referral&utm_campaign=Alert' partner:
description: "Get the latest Frontend news from our sister site"
link: "https://thenewstack.io/?utm_source=roadmap.sh&utm_medium=Referral&utm_campaign=Alert"
linkText: "TheNewStack.io"
question: question:
title: 'What is DevOps?' title: 'What is DevOps?'
description: | description: |

@ -9,6 +9,10 @@ hasTopics: true
isHidden: false isHidden: false
isUpcoming: false isUpcoming: false
isNew: true isNew: true
partner:
description: "Ready-to use free on/offboarding templates for new employees"
link: "https://www.silo.team/book-a-demo-silo-team?utm_source=affiliate1&utm_medium=referral&utm_campaign=free_onboarding_checklist"
linkText: "silo.team"
seo: seo:
title: Engineering Manager title: Engineering Manager
description: Learn what engineering management is, what engineering managers do and how to become one using our community-driven roadmap. description: Learn what engineering management is, what engineering managers do and how to become one using our community-driven roadmap.

@ -8,7 +8,10 @@ briefDescription: 'Step by step guide to becoming a frontend developer in 2025'
title: 'Frontend Developer' title: 'Frontend Developer'
description: 'Step by step guide to becoming a modern frontend developer in 2025' description: 'Step by step guide to becoming a modern frontend developer in 2025'
hasTopics: true hasTopics: true
tnsBannerLink: 'https://thenewstack.io?utm_source=roadmap.sh&utm_medium=Referral&utm_campaign=Alert' partner:
description: "Get the latest Frontend news from our sister site"
link: "https://thenewstack.io/?utm_source=roadmap.sh&utm_medium=Referral&utm_campaign=Alert"
linkText: "TheNewStack.io"
question: question:
title: 'What is a Frontend Developer?' title: 'What is a Frontend Developer?'
description: | description: |

@ -8,7 +8,10 @@ title: 'Kubernetes Roadmap'
description: 'Step by step guide to learning Kubernetes in 2025' description: 'Step by step guide to learning Kubernetes in 2025'
isNew: false isNew: false
hasTopics: true hasTopics: true
tnsBannerLink: 'https://thenewstack.io/kubernetes?utm_source=roadmap.sh&utm_medium=Referral&utm_campaign=Alert' partner:
description: "Get the latest Kubernetes news from our sister site"
link: "https://thenewstack.io/?utm_source=roadmap.sh&utm_medium=Referral&utm_campaign=Alert"
linkText: "TheNewStack.io"
dimensions: dimensions:
width: 968 width: 968
height: 1785.73 height: 1785.73

@ -9,6 +9,10 @@ hasTopics: true
isHidden: false isHidden: false
isUpcoming: false isUpcoming: false
isNew: false isNew: false
partner:
description: "Ready-to use free on/offboarding templates for new employees"
link: "https://www.silo.team/book-a-demo-silo-team?utm_source=affiliate1&utm_medium=referral&utm_campaign=free_onboarding_checklist"
linkText: "silo.team"
seo: seo:
title: Product Manager title: Product Manager
description: Learn what product management is, what product managers do and how to become one using our community-driven roadmap. description: Learn what product management is, what product managers do and how to become one using our community-driven roadmap.

@ -9,6 +9,10 @@ title: 'Software Architect'
description: 'Step by step guide to becoming a Software Architect in 2025' description: 'Step by step guide to becoming a Software Architect in 2025'
isNew: false isNew: false
hasTopics: true hasTopics: true
partner:
description: "Ready-to use free on/offboarding templates for new employees"
link: "https://www.silo.team/book-a-demo-silo-team?utm_source=affiliate1&utm_medium=referral&utm_campaign=free_onboarding_checklist"
linkText: "silo.team"
dimensions: dimensions:
width: 968 width: 968
height: 2525 height: 2525

@ -28,7 +28,11 @@ export interface RoadmapFrontmatter {
isHidden: boolean; isHidden: boolean;
isNew: boolean; isNew: boolean;
isUpcoming: boolean; isUpcoming: boolean;
tnsBannerLink?: string; partner?: {
description: string;
link: string;
linkText: string;
};
note?: string; note?: string;
question?: { question?: {
title: string; title: string;

@ -65,7 +65,7 @@ const seoDescription = `Seeking ${nounTitle.toLowerCase()} courses to enhance yo
title={title} title={title}
description={description} description={description}
note={roadmapData.note} note={roadmapData.note}
tnsBannerLink={roadmapData.tnsBannerLink} partner={roadmapData.partner}
roadmapId={roadmapId} roadmapId={roadmapId}
hasTopics={roadmapData.hasTopics} hasTopics={roadmapData.hasTopics}
isUpcoming={roadmapData.isUpcoming} isUpcoming={roadmapData.isUpcoming}

@ -107,7 +107,7 @@ const projects = await getProjectsByRoadmapId(roadmapId);
title={roadmapData.title} title={roadmapData.title}
description={roadmapData.description} description={roadmapData.description}
note={roadmapData.note} note={roadmapData.note}
tnsBannerLink={roadmapData.tnsBannerLink} partner={roadmapData.partner}
roadmapId={roadmapId} roadmapId={roadmapId}
hasTopics={roadmapData.hasTopics} hasTopics={roadmapData.hasTopics}
isUpcoming={roadmapData.isUpcoming} isUpcoming={roadmapData.isUpcoming}

@ -75,7 +75,7 @@ const { response: userCounts } =
title={title} title={title}
description={description} description={description}
note={roadmapData.note} note={roadmapData.note}
tnsBannerLink={roadmapData.tnsBannerLink} partner={roadmapData.partner}
roadmapId={roadmapId} roadmapId={roadmapId}
hasTopics={roadmapData.hasTopics} hasTopics={roadmapData.hasTopics}
isUpcoming={roadmapData.isUpcoming} isUpcoming={roadmapData.isUpcoming}

Loading…
Cancel
Save