The organometallic host–guest chemistry of porous covalent organic frameworks is explored by vapour phase infiltration of volatile organometallic precursors; namely, [Fe(η5-C5H5)2], [Co(η5-C5H5)2], and [Ru(cod)(cot)]. The unique arrangement of ferrocene molecules inside COF-102 is driven by π–π (host–guest) interactions and replicates the framework symmetry.