--- import FAQs, { type FAQType } from '../../components/FAQs/FAQs.astro'; import FrameRenderer from '../../components/FrameRenderer/FrameRenderer.astro'; import RelatedRoadmaps from '../../components/RelatedRoadmaps.astro'; import RoadmapHeader from '../../components/RoadmapHeader.astro'; import ShareIcons from '../../components/ShareIcons/ShareIcons.astro'; import { TopicDetail } from '../../components/TopicDetail/TopicDetail'; import UpcomingForm from '../../components/UpcomingForm.astro'; import { UserProgressModal } from '../../components/UserProgress/UserProgressModal'; import BaseLayout from '../../layouts/BaseLayout.astro'; import { generateArticleSchema, generateFAQSchema, } from '../../lib/jsonld-schema'; import { getOpenGraphImageUrl } from '../../lib/open-graph'; import { type RoadmapFrontmatter, getRoadmapIds } from '../../lib/roadmap'; export async function getStaticPaths() { const roadmapIds = await getRoadmapIds(); return roadmapIds.map((roadmapId) => ({ params: { roadmapId }, })); } interface Params extends Record { roadmapId: string; } const { roadmapId } = Astro.params as Params; const roadmapFile = await import( `../../data/roadmaps/${roadmapId}/${roadmapId}.md` ); const { faqs: roadmapFAQs = [] } = await import( `../../data/roadmaps/${roadmapId}/faqs.astro` ); const roadmapData = roadmapFile.frontmatter as RoadmapFrontmatter; let jsonLdSchema = []; if (roadmapData.schema) { const roadmapSchema = roadmapData.schema; jsonLdSchema.push( generateArticleSchema({ url: `https://roadmap.sh/${roadmapId}`, headline: roadmapSchema.headline, description: roadmapSchema.description, datePublished: roadmapSchema.datePublished, dateModified: roadmapSchema.dateModified, imageUrl: roadmapSchema.imageUrl, }), ); } if (roadmapFAQs.length) { jsonLdSchema.push(generateFAQSchema(roadmapFAQs as unknown as FAQType[])); } const ogImageUrl = roadmapData?.seo?.ogImageUrl || getOpenGraphImageUrl({ group: 'roadmaps', resourceId: roadmapId, }); ---
{ !roadmapData.isUpcoming && (
) } {roadmapData.isUpcoming && }