Pyrolyzed cobalt porphyrin-based conjugated mesoporous polymers as bifunctional catalysts for hydrogen production and oxygen evolution in water.