add control flow in index template for title and posts