0

I'm trying to set up a multi-blog in Jekyll one for my writing and then another section as a portfolio of sorts.

My folder structure is as follows:

KT_folder-structure

on /blog I am seeing posts from both sites even though I'm separating by category.

Any thoughts on what I could be doing wrong here?

Marcs
  • 3,768
  • 5
  • 33
  • 42

1 Answers1

1

Here how I would do ...

In your root folders, you need 2 folders _posts/blog and _posts/work (note the difference with your folders)

In your _config.yml, you'll put

defaults:
  - scope:
      path: "_posts/blog"
    values:
      type: "blog"
  - scope:
      path: "_posts/work"
    values:
      type: "work"

You will need 2 pages blog.html and work.html in which you will filter posts like this:

{% assign posts = site.posts | where:"type", "work" %}

and

{% assign posts = site.posts | where:"type", "blog" %}

Here is an example: https://github.com/yafred/organizing-posts-with-jekyll

YaFred
  • 9,698
  • 3
  • 28
  • 40
  • Thanks so much for the response. – keaton_taylor Nov 14 '16 at 05:23
  • Glad it helped. If you find the answer helpful, you can accept it. – YaFred Nov 14 '16 at 07:11
  • So actually it prematurely accepted that comment I can't duplicate the `_posts` folder. so split the two into ```_posts/blog``` and ```_work/work``` Which seems to work, except it's duplicating my content even with the ````{% assign posts = site.posts | where:"type", "type1" %}``` set out (I assume) correctly in the code. – keaton_taylor Nov 14 '16 at 13:28
  • The issue here is that blog/work are still outputting all articles (2) despite the category, type, etc. – keaton_taylor Nov 16 '16 at 20:51