diff --git a/docs/src/components/ChallengeFooter.astro b/docs/src/components/ChallengeFooter.astro index b4f2bb4..bab013e 100644 --- a/docs/src/components/ChallengeFooter.astro +++ b/docs/src/components/ChallengeFooter.astro @@ -4,11 +4,11 @@ import VideoButton from './VideoButton.astro' import ClipboardCopy from './ClipboardCopy.astro' const { labels } = Astro.props; -const {author, challenge, title, blogLink, videoLink, command} = Astro.props.entry.data; +const {author, challengeNumber, title, blogLink, videoLink, command} = Astro.props.entry.data; -const authorLink = `https://github.com/tomalaforge/angular-challenges/pulls?q=label%3A${challenge?.number}+label%3A"answer+author"`; +const authorLink = `https://github.com/tomalaforge/angular-challenges/pulls?q=label%3A${challengeNumber}+label%3A"answer+author"`; const authorDescription = `${title} solution author`; -const communityLink = `https://github.com/tomalaforge/angular-challenges/pulls?q=label%3A${challenge?.number}+label%3Aanswer`; +const communityLink = `https://github.com/tomalaforge/angular-challenges/pulls?q=label%3A${challengeNumber}+label%3Aanswer`; const communityDescription = `${title} community solutions`; const npxCommand = `npx nx serve ${command}`; --- @@ -25,7 +25,7 @@ const npxCommand = `npx nx serve ${command}`; +

{labels['challenge.footer.start'] ?? 'Your PR title must start with'} {labels['challenge.footer.answer'] ?? 'Answer:'}{challengeNumber}.

} +{ challengeNumber && author && } -{challenge?.number && } +{challengeNumber && } { renderCommentSection && } diff --git a/docs/src/components/PageTitle.astro b/docs/src/components/PageTitle.astro index 42cfd75..953d44b 100644 --- a/docs/src/components/PageTitle.astro +++ b/docs/src/components/PageTitle.astro @@ -1,15 +1,13 @@ --- import type { Props } from '@astrojs/starlight/props'; import Default from '@astrojs/starlight/components/PageTitle.astro'; -const challenge = Astro.props.entry.data.challenge; - -const {labels} = Astro.props; - +const { challengeNumber } = Astro.props.entry.data; +const { labels } = Astro.props; ---
- {challenge?.number &&
{labels['page.title.challenge'] ?? 'Challenge'} #{challenge.number}
} + {challengeNumber &&
{labels['page.title.challenge'] ?? 'Challenge'} #{challengeNumber}
}