From 6b52baf0936877ef24abc5a21a19294d9bcc46b4 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Sat, 14 Jan 2023 00:32:14 +0400 Subject: [PATCH] Add json-ld schema to the roadmap pages --- src/components/FAQs/FAQs.astro | 11 +- src/components/MarkdownRoadmap.astro | 2 +- src/layouts/BaseLayout.astro | 6 +- src/lib/jsonld-schema.ts | 20 +++- src/pages/[...topicId].astro | 8 +- src/pages/[roadmapId]/index.astro | 29 ++++-- src/roadmaps/frontend/faqs.astro | 150 ++++++++++----------------- 7 files changed, 107 insertions(+), 119 deletions(-) diff --git a/src/components/FAQs/FAQs.astro b/src/components/FAQs/FAQs.astro index f7d7447f1..13d7e2b0e 100644 --- a/src/components/FAQs/FAQs.astro +++ b/src/components/FAQs/FAQs.astro @@ -1,9 +1,14 @@ +--- +export type FAQType = { + question: string; + answer: string[]; +}; +--- +
-

- Frequently Asked Questions -

+

Frequently Asked Questions

diff --git a/src/components/MarkdownRoadmap.astro b/src/components/MarkdownRoadmap.astro index 3d1a0156b..c98c89404 100644 --- a/src/components/MarkdownRoadmap.astro +++ b/src/components/MarkdownRoadmap.astro @@ -10,7 +10,7 @@ export interface Props { const { roadmapId, description } = Astro.props; --- -
+
diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index 5fc8c78e1..8a6827aa7 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -16,7 +16,7 @@ export interface Props { noIndex?: boolean; permalink?: string; sponsor?: SponsorType; - jsonLd?: Record; + jsonLd?: Record[]; } const { @@ -26,7 +26,7 @@ const { noIndex = false, permalink = '', sponsor, - jsonLd, + jsonLd = [], } = Astro.props; // Remove trailing slashes to consider the page as canonical @@ -85,7 +85,7 @@ const commitUrl = `https://github.com/kamranahmedse/developer-roadmap/commit/${i - {jsonLd &&