I have a _posts folder that contains all my posts for my blog and projects. I'd like to separate the markdown files for my blog notes and project pages. For example, in addition to the built-in md -> HTML conversion for files in _posts, I'd like to have a _projects folder that contain my markdown files for individual project write-ups and build them into HTML when running jekyll serve.
Asked
Active
Viewed 2,524 times
3 Answers
8
just define a collections
key in your _config.yml
:
collections:
projects:
output: true
Official docs for more info..

ashmaroli
- 5,209
- 2
- 14
- 25
2
By default Jekyll will ignore new folders with an underscore prefix, so you can't use _projects
.
You can separate _posts
in several folders, to have all your project files in a specific folder, create projects/_posts
folder structure and move your project files inside projects/_posts
, leaving blog posts in _posts
.
Jekyll will generate each post and automatically assign the project
category to them, so you can also generate different lists from your blog posts.

marcanuy
- 23,118
- 9
- 64
- 113
2
Looks like you want to use categories
. Here is a link discussing a similar problem : Multiple _posts directories

Anup Kumar Gupta
- 361
- 5
- 14
-
1I couldn't get this to work, but it prompted a hacky idea I implemented, which works. I separated my notes and projects files into two subdirectories in _posts. From there, I added a layout tag to the front matter for each of these, which served to identify whether or not it was a note or project file. To display all projects in my projects overview page, I used this`{% for post in site.posts %} {% if post.layout == "project" and post.status == "in-progress" %}` – Jason Bak Jul 23 '17 at 16:24
-
@JasonBak _posts folder shouldn't contain subdirectories. – marcanuy Jul 23 '17 at 18:31