Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to separate Jekyll posts into two different folders?

Tags:

jekyll

I have a _posts folder and I just want a simple way to separate the posts in the folder into two different folders, and not have any permalink changes, for purely organizational reasons.

like image 629
ThomasReggi Avatar asked Dec 21 '12 23:12

ThomasReggi


2 Answers

Just create subdirectories in your _posts directory; the subdirectories will be ignored when Jekyll generates permalinks.

like image 79
seliopou Avatar answered Nov 13 '22 05:11

seliopou


I recently did this to my _posts folder because I have over 200 files. I decided to create folders that represent each year I have a posts for. Doing this though, broke post_url. The error is something like as follows when you run jekyll build

Liquid Exception: Could not find post "blah-blah" in tag 'post_url'. Make sure the post exists and the name is correct. in _posts/2007/blah-blah.md

I had to go back in and where ever I used post_url, I had to add /year/ in front of each post url links.

https://github.com/jekyll/jekyll/issues/1714#issuecomment-28167702

like image 23
w1n78 Avatar answered Nov 13 '22 05:11

w1n78