use contents instead of index file to generate not only the first level but also the subdirectories to fix #77