Reputation: 337
I'm making a website/blog that catalogs DIY projects, currently I have each project as a post, and recent posts are displayed on the home page.
What Im trying to do is have a separate page with project/post categories (projects.html). This page lists a collection of post categories that manually I've made, and will not show any actual posts.
I would then like these categories/collection items to be generated into a page that links to a layout where I can specify a FOR loop that will display each post specific to that category on the page.
I've tried many ways to generate pages from a collection of .md files as jekyll does for posts but I can't get this working. Is this possible to do? or is there a way to automatically generate an html page for every .md file in a folder?
Here is a link to the page I'm working with. http://happy-swallow.cloudvent.net/
Thanks!
Upvotes: 5
Views: 2053
Reputation: 23972
You can use Collections and specify to render each file in the collection folder as a page:
tell Jekyll to render individual collection pages, in _config.yml
:
collections:
my_collection:
output: true
Then create a folder named _my_collection
(the folder name must start with an underscore) and every markdown file inside it will have a single page.
Upvotes: 3