use config to generate index