Sort before creating HTML files