From 29007372f0990ef0cf5cc2556b89c719f98d7189 Mon Sep 17 00:00:00 2001 From: Andrei Liviu Georgescu <146103342+andreilgeorgescu@users.noreply.github.com> Date: Mon, 9 Dec 2024 18:11:32 +0000 Subject: [PATCH 1/7] Remove optional 'extra' field from course schema and related content --- src/collections/courses.ts | 5 ----- src/content/courses/zio-rite-of-passage/index.mdx | 2 -- 2 files changed, 7 deletions(-) diff --git a/src/collections/courses.ts b/src/collections/courses.ts index 5a86e739..3c2c3462 100644 --- a/src/collections/courses.ts +++ b/src/collections/courses.ts @@ -55,11 +55,6 @@ export default defineCollection({ path: ["excerpt"], }, ), - extra: z - .object({ - title: z.string().max(70, "Title must be at most 70 characters"), - }) - .optional(), faqs: z .array( z diff --git a/src/content/courses/zio-rite-of-passage/index.mdx b/src/content/courses/zio-rite-of-passage/index.mdx index 75ef53d6..531bcda3 100644 --- a/src/content/courses/zio-rite-of-passage/index.mdx +++ b/src/content/courses/zio-rite-of-passage/index.mdx @@ -29,8 +29,6 @@ features: one: images/feature1.png two: images/feature2.png three: images/feature3.png -extra: - title: What will you build? --- import CourseLayout from "@pages/courses/_layouts/CourseLayout.astro"; From 45d344cafabca46ca1d7ffd27d4f6dd1aec9fb89 Mon Sep 17 00:00:00 2001 From: Andrei Liviu Georgescu <146103342+andreilgeorgescu@users.noreply.github.com> Date: Mon, 9 Dec 2024 18:32:40 +0000 Subject: [PATCH 2/7] Rename frontmatter variable to improve clarity in ArticleLayout --- src/pages/articles/_layouts/ArticleLayout.astro | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pages/articles/_layouts/ArticleLayout.astro b/src/pages/articles/_layouts/ArticleLayout.astro index e309870c..5e881ba9 100644 --- a/src/pages/articles/_layouts/ArticleLayout.astro +++ b/src/pages/articles/_layouts/ArticleLayout.astro @@ -23,7 +23,7 @@ interface Props { } const { article, headings, minutesRead } = Astro.props; -const frontmatter = article.data; +const _frontmatter = article.data; const { canonicalUrl, description, @@ -34,12 +34,12 @@ const { title, updatedDate, videoId, -} = frontmatter; +} = _frontmatter; const author = await getEntry( - frontmatter.author.collection, - frontmatter.author.id, + _frontmatter.author.collection, + _frontmatter.author.id, ); -const tags = await getEntries(frontmatter.tags); +const tags = await getEntries(_frontmatter.tags); const structuredData = JSON.stringify({ "@context": "https://schema.org", From 7d02e1d1dd8dbfa04b63ecd74e6c2bb1009d3e63 Mon Sep 17 00:00:00 2001 From: Andrei Liviu Georgescu <146103342+andreilgeorgescu@users.noreply.github.com> Date: Mon, 9 Dec 2024 18:32:59 +0000 Subject: [PATCH 3/7] Add tags and authors filtering to CourseLayout for improved search functionality --- src/pages/courses/_layouts/CourseLayout.astro | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/pages/courses/_layouts/CourseLayout.astro b/src/pages/courses/_layouts/CourseLayout.astro index 106648be..baf14b02 100644 --- a/src/pages/courses/_layouts/CourseLayout.astro +++ b/src/pages/courses/_layouts/CourseLayout.astro @@ -48,6 +48,7 @@ const [bundledCourses, _categoryFrontmatter, collaborators] = await Promise.all( : [], ], ); +const tags = await getEntries(_frontmatter.tags); const { color: categoryColor, faqs: categoryFaqs } = _categoryFrontmatter; const { includedInMembership, @@ -160,6 +161,17 @@ const structuredData = JSON.stringify({ image={{ alt: title, src: heroImage.src }} {structuredData} > + { + instructors.map((instructor) => ( +
+ )) + } + { + collaborators.map((collaborator) => ( + + )) + } + {tags.map((tag) => )}