Formation mechanism of porous single-crystal Cr2O3 and Co3O4 templated by mesoporous silica