diff --git a/src/pages/[roadmapId]/index.astro b/src/pages/[roadmapId]/index.astro
index 39de35fbd..21e40d499 100644
--- a/src/pages/[roadmapId]/index.astro
+++ b/src/pages/[roadmapId]/index.astro
@@ -1,5 +1,5 @@
---
-import FAQs from '../../components/FAQs/FAQs.astro';
+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';
@@ -50,7 +50,7 @@ if (roadmapData.schema) {
}
if (roadmapFAQs.length) {
- jsonLdSchema.push(generateFAQSchema(roadmapFAQs));
+ jsonLdSchema.push(generateFAQSchema(roadmapFAQs as unknown as FAQType[]));
}
---
@@ -115,7 +115,7 @@ if (roadmapFAQs.length) {
client:only='react'
/>
-
+
diff --git a/src/pages/backend/languages.astro b/src/pages/backend/languages.astro
index 452a2c72f..aa07fc413 100644
--- a/src/pages/backend/languages.astro
+++ b/src/pages/backend/languages.astro
@@ -5,7 +5,10 @@ import BaseLayout from '../../layouts/BaseLayout.astro';
import { getGuideById } from '../../lib/guide';
const guideId = 'backend-languages';
-const guide = await getGuideById('backend-languages');
+const guide = await getGuideById(guideId).catch(() => null);
+if (!guide) {
+ return Astro.redirect('/404');
+}
const { frontmatter: guideData } = guide;
---
diff --git a/src/pages/guides/[guideId].astro b/src/pages/guides/[guideId].astro
index 8962bbb97..65455016e 100644
--- a/src/pages/guides/[guideId].astro
+++ b/src/pages/guides/[guideId].astro
@@ -2,25 +2,21 @@
import GuideHeader from '../../components/GuideHeader.astro';
import MarkdownFile from '../../components/MarkdownFile.astro';
import BaseLayout from '../../layouts/BaseLayout.astro';
-import { getAllGuides, type GuideFileType } from '../../lib/guide';
+import { getGuideById } from '../../lib/guide';
-export interface Props {
- guide: GuideFileType;
+interface Params extends Record {
+ guideId: string;
}
-export async function getStaticPaths() {
- const guides = (await getAllGuides()).filter(
- (guide) => !guide.frontmatter.excludedBySlug,
- );
-
- return guides.map((guide) => ({
- params: { guideId: guide.id },
- props: { guide },
- }));
+const { guideId } = Astro.params;
+if (!guideId) {
+ return Astro.redirect('/404');
+}
+const guide = await getGuideById(guideId!).catch(() => null);
+if (!guide) {
+ return Astro.redirect('/404');
}
-const { guideId } = Astro.params;
-const { guide } = Astro.props;
const { frontmatter: guideData } = guide;
---
diff --git a/src/pages/questions/[questionGroupId].astro b/src/pages/questions/[questionGroupId].astro
index 4ebdaef45..666c84458 100644
--- a/src/pages/questions/[questionGroupId].astro
+++ b/src/pages/questions/[questionGroupId].astro
@@ -6,13 +6,12 @@ import Footer from '../../components/Footer.astro';
import AstroIcon from '../../components/AstroIcon.astro';
import { QuestionsList } from '../../components/Questions/QuestionsList';
-import {
- getAllQuestionGroups,
- getQuestionGroupById,
-} from '../../lib/question-group';
+import { getQuestionGroupById } from '../../lib/question-group';
const { questionGroupId } = Astro.params;
-const questionGroup = await getQuestionGroupById(questionGroupId);
+const questionGroup = await getQuestionGroupById(questionGroupId!).catch(
+ () => null,
+);
if (!questionGroup) {
return Astro.redirect('/404');
}
@@ -40,7 +39,7 @@ const { frontmatter } = questionGroup;
>
←
- Back to all Questions
+ Back to all Questions
diff --git a/src/pages/u/[username]/[roadmapId]/index.astro b/src/pages/u/[username]/[roadmapId]/index.astro
deleted file mode 100644
index a5a37d1e7..000000000
--- a/src/pages/u/[username]/[roadmapId]/index.astro
+++ /dev/null
@@ -1,42 +0,0 @@
----
-import { userApi } from '../../../../api/user';
-import AccountLayout from '../../../../layouts/AccountLayout.astro';
-import { UserProfileRoadmap } from '../../../../components/UserPublicProfile/UserProfileRoadmap';
-
-interface Params extends Record {
- username: string;
- roadmapId: string;
-}
-
-const { username, roadmapId } = Astro.params as Params;
-if (!username) {
- return Astro.redirect('/404');
-}
-
-const userClient = userApi(Astro as any);
-const { response: userDetails, error } =
- await userClient.getPublicProfile(username);
-
-if (error || !userDetails) {
- return Astro.redirect('/404');
-}
-
-const { response: roadmapDetails, error: progressError } =
- await userClient.getUserProfileRoadmap(username, roadmapId);
-
-if (progressError || !roadmapDetails) {
- return Astro.redirect('/404');
-}
----
-
-
-
-