7
votes

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.

1
So, you want the portfolio entries to only show up in the portfolio index (be unclickable) and not show up anywhere else?Brett Hardin
@BrettHardin Exactly.Alex Marchant
Try to add the files to the _config file using the YAML: exclude: [dir1, file1, dir2] I don't know if this will work or not, but try it and let me know.Brett Hardin
@BrettHardin good idea, doesn't seem to work though.Alex Marchant

1 Answers

2
votes

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.