refactored post rendering into a subtemplate