Search code examples
rubyjekyllliquidoctopress

Adding a post type to octopress


I am working on a blog for my personal use and wanted to add a news feature in it. This feature will show five recent news markdown files that I have placed inside the _news folder. But i am unable to understand how to access the directory using the liquid markup in the template just like it is done for posts in the _posts folder.


Solution

  • Try using collections rather than posts. Collections can be iterated through by Jekyll/Liquid using {% for n in site.news %}, for the news collection.