Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to stop Jekyll from generating a page for each post

Tags:

ruby

jekyll

I'm using Jekyll for a blog/portfolio site. I have several posts which are portfolio entries, and several which are blog entries.

I am able to use the portfolio-entry posts to build a portfolio page (www.alexmarchant.com/portfolio), but Jekyll still generates a permalinked individual page for each portfolio entry. Is there any way to turn this off?

I've tried the following in the YAML front-matter section of the posts:

  • permalink: none
  • permalink: false

Neither works.

like image 587
Alex Marchant Avatar asked Feb 28 '13 03:02

Alex Marchant


1 Answers

I found one hack to do what you want: when you set the permalink to be an already existent page, then it won't be generated (the original page would be there), but it still would be available as an post/page entity in Jekyll.

So, if you'd have an index page for portfolio at such url: /portfolio/index.html, and then in your /_posts/ you would have any posts which would have this in YAML front matter: permalink: /portfolio/index.html, then those pages wouldn't be generated.

like image 70
kizu Avatar answered Nov 03 '22 11:11

kizu