---import { get } from'/content';// Fetch everythingconstallContent=awaitget(Astro.glob('/content/**/*.{md,mdx,yaml}'));// For auto-completion to show up,// ✨ start typing a '.' here ——————vconsttryAutoCompletion= allContent ; // Narrow fetching to some entities, for performanceconstcontent=awaitget( Astro.glob('/content/{robots,people}/**/*.{md,mdx,yaml}'),);// Let's be more specific by getting a single entryconstbigGrumpy= content?.robots?.bigGrumpy;// Or even get the MD(X) body component directlyconstBigGrumpyMainContent= content?.robots?.bigGrumpy?.main.Content;---<bigGrumpy.main.Content /><BigGrumpyMainContent /><span>{bigGrumpy?.meta?.price}</span><!-- Pass data down to component, with end-to-end type safety --><Robotfeats={bigGrumpy}>
In an Astro component
---import { type Robot } from'/content';// Augment your <Robot /> `Props`const { feats } = Astro.props as { feats:Robot };---<feats.main.Content /><!-- As always, you get type safety and auto-completion everywhere! --><!-- If it can break here, you'll know it soon while refactoring. --><span>{feats?.meta?.price}</span>