MCPcopy Index your code
hub / github.com/simstudioai/sim / loadPostComponents

Function loadPostComponents

apps/sim/lib/blog/registry.ts:137–156  ·  view source on GitHub ↗
(slug: string)

Source from the content-addressed store, hash-verified

135}
136
137async function loadPostComponents(slug: string): Promise<Record<string, React.ComponentType>> {
138 if (postComponentsRegistry[slug]) {
139 return postComponentsRegistry[slug]
140 }
141
142 const loader = BLOG_COMPONENT_LOADERS[slug]
143 if (!loader) {
144 postComponentsRegistry[slug] = {}
145 return {}
146 }
147
148 try {
149 const postComponents = await loader()
150 postComponentsRegistry[slug] = postComponents
151 return postComponents
152 } catch {
153 postComponentsRegistry[slug] = {}
154 return {}
155 }
156}
157
158export async function getPostBySlug(slug: string): Promise<BlogPost> {
159 const meta = await scanFrontmatters()

Callers 1

getPostBySlugFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected