mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-13 06:13:03 -05:00
docs(comment section): add custom config
This commit is contained in:
@@ -3,7 +3,7 @@ import type { Props } from '@astrojs/starlight/props';
|
|||||||
import Default from '@astrojs/starlight/components/MarkdownContent.astro';
|
import Default from '@astrojs/starlight/components/MarkdownContent.astro';
|
||||||
|
|
||||||
const slug = Astro.props.slug;
|
const slug = Astro.props.slug;
|
||||||
const renderCommentSection = !(['', 'challenges/testing', 'challenges/angular-performance']).includes(slug)
|
const renderCommentSection = !Astro.props.entry.data.noCommentSection;
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
@@ -12,6 +12,8 @@ const renderCommentSection = !(['', 'challenges/testing', 'challenges/angular-pe
|
|||||||
|
|
||||||
<div class="border-t"></div>
|
<div class="border-t"></div>
|
||||||
|
|
||||||
|
{Astro.props.entry.data.custom}
|
||||||
|
|
||||||
{ renderCommentSection
|
{ renderCommentSection
|
||||||
?
|
?
|
||||||
<script src="https://giscus.app/client.js"
|
<script src="https://giscus.app/client.js"
|
||||||
|
|||||||
@@ -1,7 +1,13 @@
|
|||||||
import { defineCollection } from 'astro:content';
|
|
||||||
import { docsSchema, i18nSchema } from '@astrojs/starlight/schema';
|
import { docsSchema, i18nSchema } from '@astrojs/starlight/schema';
|
||||||
|
import { defineCollection, z } from 'astro:content';
|
||||||
|
|
||||||
export const collections = {
|
export const collections = {
|
||||||
docs: defineCollection({ schema: docsSchema() }),
|
docs: defineCollection({
|
||||||
|
schema: (ctx) =>
|
||||||
|
docsSchema()(ctx).extend({
|
||||||
|
// Add a new optional field to the schema.
|
||||||
|
noCommentSection: z.boolean().optional(),
|
||||||
|
}),
|
||||||
|
}),
|
||||||
i18n: defineCollection({ type: 'data', schema: i18nSchema() }),
|
i18n: defineCollection({ type: 'data', schema: i18nSchema() }),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: 🟠 Optimize Big List
|
title: 🟠 Optimize Big List
|
||||||
description: Challenge 37 is about learning how virtualization optimize big list rendering
|
description: Challenge 37 is about learning how virtualization optimize big list rendering
|
||||||
toto: skldfjklsdlfkj
|
|
||||||
sidebar:
|
sidebar:
|
||||||
order: 117
|
order: 117
|
||||||
badge: New
|
badge: New
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ title: Angular Performance
|
|||||||
prev: false
|
prev: false
|
||||||
next: false
|
next: false
|
||||||
description: Learn how to use the Angular Devtool chrome extension.
|
description: Learn how to use the Angular Devtool chrome extension.
|
||||||
|
noCommentSection: true
|
||||||
sidebar:
|
sidebar:
|
||||||
order: 1
|
order: 1
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ title: Testing
|
|||||||
prev: false
|
prev: false
|
||||||
next: false
|
next: false
|
||||||
description: Introduction to testing challenges.
|
description: Introduction to testing challenges.
|
||||||
|
noCommentSection: true
|
||||||
sidebar:
|
sidebar:
|
||||||
order: 1
|
order: 1
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
title: Welcome to Angular Challenges
|
title: Welcome to Angular Challenges
|
||||||
description: Get started by resolving those challenges and becoming a better Angular FrontEnd engineer.
|
description: Get started by resolving those challenges and becoming a better Angular FrontEnd engineer.
|
||||||
template: splash
|
template: splash
|
||||||
|
noCommentSection: true
|
||||||
hero:
|
hero:
|
||||||
tagline: Start now and become an Angular Expert!
|
tagline: Start now and become an Angular Expert!
|
||||||
image:
|
image:
|
||||||
|
|||||||
Reference in New Issue
Block a user