feat: add collection for authors

This commit is contained in:
thomas
2023-11-23 22:42:42 +04:00
parent 311d8128b2
commit 6cb5c5c415
88 changed files with 192 additions and 117 deletions

View File

@@ -1,15 +1,18 @@
---
import ChallengeFooter from './ChallengeFooter.astro'
import CommentSection from './CommentSection.astro'
import type { Props } from '@astrojs/starlight/props';
import Default from '@astrojs/starlight/components/MarkdownContent.astro';
import type { Props } from '@astrojs/starlight/props';
import { getEntry } from 'astro:content';
import Author from './Author.astro';
import ChallengeFooter from './ChallengeFooter.astro';
import CommentSection from './CommentSection.astro';
const {challengeNumber, author} = Astro.props.entry.data;
const {challengeNumber} = Astro.props.entry.data;
const author = Astro.props.entry.data.author ? await getEntry(Astro.props.entry.data.author) : null;
const renderCommentSection = !Astro.props.entry.data.noCommentSection;
---
{ challengeNumber && author && <p class="author">Created by {author}</p> }
{ challengeNumber && author && <Author {...author.data}/> }
<Default {...Astro.props}><slot /></Default>