in _includes/resources/topic/TopicLayout.11ty.tsx [9:34]
export function TopicLayout(
this: LayoutContext,
data: TopicLayoutData,
): JSX.Element {
const { collections, content, page } = data;
const topic = collections.resourceMap.get(`topics:${page.fileSlug}`) as Topic;
if (!topic) {
throw new Error(`Topic "${page.fileSlug}" not in collection`);
}
const linkedResources = this.getResources().filter(
// @ts-ignore
(ci) => ci.topics && ci.topics.includes(topic.label),
);
const listing = (
<Fragment>
{linkedResources.map((resource) => (
// @ts-ignore
<ResourceCard resource={resource}></ResourceCard>
))}
</Fragment>
);
return <ReferenceLayout {...data} listing={listing} content={content} />;
}