Bug correction

Correction of a bug that prevented correct generation of index.html by year.
Articles are now sorted by date in month and year index pages.
Flake8 errors corrected

Corrected all errors given by Flake8 except line length