diff --git a/src/pages/[roadmapId]/index.astro b/src/pages/[roadmapId]/index.astro
index 7e9552962..37835a3fd 100644
--- a/src/pages/[roadmapId]/index.astro
+++ b/src/pages/[roadmapId]/index.astro
@@ -2,6 +2,7 @@
import CaptchaScripts from '../../components/Captcha/CaptchaScripts.astro';
import FAQs from '../../components/FAQs/FAQs.astro';
import InteractiveRoadmap from '../../components/InteractiveRoadmap/InteractiveRoadmap.astro';
+import MarkdownFile from '../../components/MarkdownFile.astro';
import MarkdownRoadmap from '../../components/MarkdownRoadmap.astro';
import RoadmapHeader from '../../components/RoadmapHeader.astro';
import UpcomingRoadmap from '../../components/UpcomingRoadmap.astro';
@@ -78,9 +79,11 @@ if (roadmapFAQs.length) {
{
!roadmapData.isUpcoming && !roadmapData.jsonUrl && (
-
-
-
+
+
+
+
+
)
}
diff --git a/src/pages/best-practices/[bestPracticeId].astro b/src/pages/best-practices/[bestPracticeId].astro
new file mode 100644
index 000000000..03a7a5744
--- /dev/null
+++ b/src/pages/best-practices/[bestPracticeId].astro
@@ -0,0 +1,86 @@
+---
+import CaptchaScripts from '../../components/Captcha/CaptchaScripts.astro';
+import FAQs from '../../components/FAQs/FAQs.astro';
+import InteractiveRoadmap from '../../components/InteractiveRoadmap/InteractiveRoadmap.astro';
+import MarkdownFile from '../../components/MarkdownFile.astro';
+import RoadmapHeader from '../../components/RoadmapHeader.astro';
+import UpcomingRoadmap from '../../components/UpcomingRoadmap.astro';
+import BaseLayout from '../../layouts/BaseLayout.astro';
+import { BestPracticeFrontmatter,getBestPracticeIds } from '../../lib/best-pratice';
+import { generateArticleSchema } from '../../lib/jsonld-schema';
+
+export async function getStaticPaths() {
+ const bestPracticeIds = await getBestPracticeIds();
+
+ return bestPracticeIds.map((bestPracticeId) => ({
+ params: { bestPracticeId },
+ }));
+}
+
+interface Params extends Record
{
+ bestPracticeId: string;
+}
+
+const { bestPracticeId } = Astro.params as Params;
+const bestPracticeFile = await import(`../../best-practices/${bestPracticeId}/${bestPracticeId}.md`);
+const { faqs: roadmapFAQs = [] } = await import(`../../roadmaps/${bestPracticeId}/faqs.astro`);
+const bestPracticeData = bestPracticeFile.frontmatter as BestPracticeFrontmatter;
+
+let jsonLdSchema = [];
+
+if (bestPracticeData.schema) {
+ const bestPracticeSchema = bestPracticeData.schema;
+ jsonLdSchema.push(
+ generateArticleSchema({
+ url: `https://roadmap.sh/best-practices/${bestPracticeId}`,
+ headline: bestPracticeSchema.headline,
+ description: bestPracticeSchema.description,
+ datePublished: bestPracticeSchema.datePublished,
+ dateModified: bestPracticeSchema.dateModified,
+ imageUrl: bestPracticeSchema.imageUrl,
+ })
+ );
+}
+---
+
+
+
+
+ {
+ !bestPracticeData.isUpcoming && bestPracticeData.jsonUrl && (
+
+ )
+ }
+
+ {
+ !bestPracticeData.isUpcoming && !bestPracticeData.jsonUrl && (
+
+
+
+ )
+ }
+
+ {bestPracticeData.isUpcoming && }
+
+
+
+
+
diff --git a/src/pages/guides/[guideId].astro b/src/pages/guides/[guideId].astro
index ce7a4480d..285770731 100644
--- a/src/pages/guides/[guideId].astro
+++ b/src/pages/guides/[guideId].astro
@@ -1,5 +1,6 @@
---
import GuideHeader from '../../components/GuideHeader.astro';
+import MarkdownFile from '../../components/MarkdownFile.astro';
import BaseLayout from '../../layouts/BaseLayout.astro';
import { getAllGuides, GuideFileType } from '../../lib/guide';
@@ -30,10 +31,8 @@ const { frontmatter: guideData } = guide;