Shaped ceramics with tunable magnetic properties from metal-containing polymers