Jason Bak
Jason Bak

Reputation: 91

Jekyll -- create another folder with similar functionality of _posts

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.

Upvotes: 5

Views: 3079

Answers (3)

marcanuy
marcanuy

Reputation: 23972

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.

Upvotes: 2

Anup Kumar Gupta
Anup Kumar Gupta

Reputation: 361

Looks like you want to use categories. Here is a link discussing a similar problem : Multiple _posts directories

Upvotes: 2

ashmaroli
ashmaroli

Reputation: 5444

just define a collections key in your _config.yml:

collections:
  projects:
    output: true

Official docs for more info..

Upvotes: 9

Related Questions