From 6f337f6b5378db34c9c60f45aa5ed0db70e16a7e Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Mon, 2 Jan 2023 14:59:33 +0400 Subject: [PATCH] Add topics listing page --- src/components/Breadcrumbs.astro | 2 - src/lib/topic.ts | 23 ++++++++++- src/pages/[roadmapId].astro | 47 --------------------- src/pages/[roadmapId]/index.astro | 47 +++++++++++++++++++++ src/pages/[roadmapId]/topics.astro | 66 ++++++++++++++++++++++++++++++ 5 files changed, 134 insertions(+), 51 deletions(-) delete mode 100644 src/pages/[roadmapId].astro create mode 100644 src/pages/[roadmapId]/index.astro create mode 100644 src/pages/[roadmapId]/topics.astro diff --git a/src/components/Breadcrumbs.astro b/src/components/Breadcrumbs.astro index 951391e17..e8841a18c 100644 --- a/src/components/Breadcrumbs.astro +++ b/src/components/Breadcrumbs.astro @@ -12,8 +12,6 @@ const { breadcrumbs, roadmapId } = Astro.props;
+
+ { + topics.map((topic) => { + // Breadcrumbs have three additional items e.g. + // + // Roadmaps / Frontend / Topics / Internet / HTTP + // ---^----------^---------^---- + // + // Subtracting 3 to get the total parent count + const totalParentCount = topic.breadcrumbs.length - 3; + + return ( + + {topic.text} + + ); + }) + } +
+
+