Friday, February 07, 2020

Create a New Post Type in Jekyll

Create a directory called _stories.

Update _config.yml file:

collections:
  stories:
    output: true

Create a story.html file in the _layouts directory.

---
layout: default
---

{{ title }}


{{ content }}

Page

---
layout: story
title: Story Title Goes Here
description: "The story description text goes here"
---

Create a stories.html page in the site root to act as the index page for the stories.

{% for item in site.stories %}
 

{{ item.title }}


  {{ item.description }}
  {{ item.title }}
{% endfor %}