Shape-preserving chemical conversion of architected nanocomposites