From 8fb3e7983b50c3da669bbdcc72edcdc11fbd7738 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Thu, 9 Nov 2023 21:36:58 +0000 Subject: [PATCH] Partial usage in the topics --- src/components/TopicDetail/TopicDetail.tsx | 8 +---- src/pages/[roadmapId]/[...topicId].astro | 35 ++-------------------- 2 files changed, 4 insertions(+), 39 deletions(-) diff --git a/src/components/TopicDetail/TopicDetail.tsx b/src/components/TopicDetail/TopicDetail.tsx index 2dfa984c4..968e27cf1 100644 --- a/src/components/TopicDetail/TopicDetail.tsx +++ b/src/components/TopicDetail/TopicDetail.tsx @@ -158,13 +158,7 @@ export function TopicDetail(props: TopicDetailProps) { } let topicHtml = ''; if (!isCustomResource) { - // It's full HTML with page body, head etc. - // We only need the inner HTML of the #main-content - const node = new DOMParser().parseFromString( - response as string, - 'text/html', - ); - topicHtml = node?.getElementById('main-content')?.outerHTML || ''; + topicHtml = response as string; } else { setLinks((response as RoadmapContentDocument)?.links || []); setTopicTitle((response as RoadmapContentDocument)?.title || ''); diff --git a/src/pages/[roadmapId]/[...topicId].astro b/src/pages/[roadmapId]/[...topicId].astro index 1edb3624f..d8094a560 100644 --- a/src/pages/[roadmapId]/[...topicId].astro +++ b/src/pages/[roadmapId]/[...topicId].astro @@ -24,40 +24,11 @@ export async function getStaticPaths() { }); } +export const partial = true; + const { topicId } = Astro.params; const { file, roadmapId, roadmap, heading } = Astro.props as RoadmapTopicFileType; - -const gitHubBaseUrl = - 'https://github.com/kamranahmedse/developer-roadmap/blob/master/src/data'; -const gitHubFullUrl = file.file.replace(/^.+\/src\/data/, `${gitHubBaseUrl}/`); -const gitHubRelativeUrl = file.file.replace(/^.+\/src\/data/, 'src/data'); --- - - -
-
-
- -
- -

- Found any mistakes? Help us improve by updating the file here.. -

-
-
-
+ \ No newline at end of file