Heterogeneous catalysis is often plagued by incompatibility of a catalyst’s reactivity and stability. Now, covalent organic frameworks linked by reactive, yet stable, N-heterocyclic carbene precursors are synthesized and the frameworks are subsequently used as cathodes in Li–S batteries.