Incorporating magnesium and calcium cations in porous organic frameworks for high-capacity hydrogen storage.