Template-realized functional nanostructures for energy conversion and storage devices