Fixed a bug where the latest post wasn't generated properly and cleaned up the generation code.