Files
angular-challenges/docs/src/components/Content.astro
2023-11-23 22:42:52 +04:00

29 lines
904 B
Plaintext

---
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} = 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 && <Author {...author.data}/> }
<Default {...Astro.props}><slot /></Default>
{challengeNumber && <ChallengeFooter {...Astro.props} />}
{ renderCommentSection && <CommentSection /> }
<style>
.author {
margin-top: -1rem;
font-size: var(--sl-text-xs);
color: var(--sl-color-gray-3);
}
</style>