# Creating a second blog page

**URL:** <https://talk.jekyllrb.com/t/creating-a-second-blog-page/7574>\
**Category:** Help\
**Created:** [August 16, 2022, 7:22pm UTC](https://talk.jekyllrb.com/t/creating-a-second-blog-page/7574 "2022-08-16T19:22:36Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![toast](https://avatars.discourse-cdn.com/v4/letter/t/6f9a4e/32.png) [@toast](https://talk.jekyllrb.com/u/toast)\
**Post date:** [August 16, 2022, 7:22pm UTC](https://talk.jekyllrb.com/t/creating-a-second-blog-page/7574/1 "2022-08-16T19:22:36Z")

</div>

I’d like to have two pages with lists of posts. Currently the blog page is being populated ok, but the other page is not being populated even though I’ve set them up the same way.

I don’t understand why the posts on the page I’m trying to create don’t populate.

Is blog a keyword or something?

I’ve copied the structure of the blog page.

navigation

```auto
main:
  - title: "-"
    url: /portfolio/

  - title: "Blog"
    url: /blog/

```

I have a folders containing posts:

- \_blog
- \_portfolio

blog.html:

```auto
---
layout: archive
title: ""
permalink: /blog/
author_profile: false
---

{% include base_path %}

{% for post in site.posts %}
  {% include archive.html %}
{% endfor %}

```

portfolio.html

```auto
---
layout: archive
title: ""
permalink: /portfolio/
author_profile: false
---

{% include base_path %}

{% for post in site.portfolio %}
  {% include archive.html %}
{% endfor %}

```

in my \_config.yaml

```auto
# Defaults
defaults:
  # _posts
  - scope:
      path: ""
      type: posts
    values:
      layout: single
      author_profile: false
      read_time: false
      comments: true
      share: true
      related: true
  # _pages
  - scope:
      path: ""
      type: pages
    values:
      layout: single
      author_profile: true
  # _portfolio
  - scope:
      path: ""
      type: posts
    values:
      layout: single
      author_profile: false
      read_time: false
      comments: true
      share: true
      related: true

```

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [August 17, 2022, 1:48am UTC](https://talk.jekyllrb.com/t/creating-a-second-blog-page/7574/2 "2022-08-17T01:48:42Z")

</div>

> [@toast](#):
>
> `for post in site.portfolio`

`site.posts` is a thing - but unless you setup a collection called portfolio `site.portfolio` won’t work.

You could try doing them both as posts but using categories - you can use a folder named blog and have a \_posts folder inside it, then they will all be category = blog, you could then have a folder named portfolio with a \_posts folder inside it and then those would be category = portfolio. You could then filter site.posts to just get the ones that match a given category.

Or you could probably do them as collections, depends on if you are using any of the posts features which maybe the archive.html is.

---

<div class="post-metadata">

**Author:** ![toast](https://avatars.discourse-cdn.com/v4/letter/t/6f9a4e/32.png) [@toast](https://talk.jekyllrb.com/u/toast)\
**Post date:** [August 17, 2022, 2:55am UTC](https://talk.jekyllrb.com/t/creating-a-second-blog-page/7574/3 "2022-08-17T02:55:11Z")

</div>

I added this to my config and still no luck. This seems much easier than creating more folders with \_posts folders in each.

```auto
collections:
  - portfolio

```

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [August 17, 2022, 3:18am UTC](https://talk.jekyllrb.com/t/creating-a-second-blog-page/7574/4 "2022-08-17T03:18:47Z")

</div>

> [@toast](#):
>
> ` {% include archive.html %}`

try doing it without the include and just see if you can get it to output the title to see if the collection is working.

Can you share a link to the repo?

---

<div class="post-metadata">

**Author:** ![toast](https://avatars.discourse-cdn.com/v4/letter/t/6f9a4e/32.png) [@toast](https://talk.jekyllrb.com/u/toast)\
**Post date:** [August 17, 2022, 12:57pm UTC](https://talk.jekyllrb.com/t/creating-a-second-blog-page/7574/5 "2022-08-17T12:57:32Z")

</div>

That breaks it, and there is kinda some non-public stuff in the drafts so its a private repo atm.

```auto
         Rendering: _pages/portfolio.html
  Pre-Render Hooks: _pages/portfolio.html
  Rendering Liquid: _pages/portfolio.html
github-pages 227 | Error: Liquid syntax error (line 5): Unknown tag 'archive'

```

---

<div class="post-metadata">

**Author:** ![toast](https://avatars.discourse-cdn.com/v4/letter/t/6f9a4e/32.png) [@toast](https://talk.jekyllrb.com/u/toast)\
**Post date:** [August 17, 2022, 1:29pm UTC](https://talk.jekyllrb.com/t/creating-a-second-blog-page/7574/6 "2022-08-17T13:29:11Z")

</div>

I also tried the solution of \_posts in separate folders.

It doesn’t work either, now nothing shows.

portfolio → \_posts  
blog → \_posts

blog.html is now:

```auto
---
layout: archive
title: ""
permalink: /blog/
author_profile: false
---

{% include base_path %}

{% for post in site.blog if post.category == blog %}
  {% include archive.html %}
{% endfor %}

```

portfolio.html

```auto
---
layout: archive
title: ""
permalink: /portfolio/
author_profile: false
---

{% include base_path %}

{% for post in site.portfolio if post.category == portfolio %}
  {% include archive.html %}
{% endfor %}

```

---

<div class="post-metadata">

**Author:** ![toast](https://avatars.discourse-cdn.com/v4/letter/t/6f9a4e/32.png) [@toast](https://talk.jekyllrb.com/u/toast)\
**Post date:** [August 17, 2022, 1:33pm UTC](https://talk.jekyllrb.com/t/creating-a-second-blog-page/7574/7 "2022-08-17T13:33:19Z")

</div>

I also tried for post in site.blog.posts and no luck

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [August 17, 2022, 3:50pm UTC](https://talk.jekyllrb.com/t/creating-a-second-blog-page/7574/8 "2022-08-17T15:50:13Z")

</div>

I am not so sure your if category is correct.

Need to do one step at a time - if you do it as posts just use the folder structure but don’t try to use the category yet - just see if you can get both pages to show all the posts. Then work on showing just one category.

If you do it as a collection, my comment was there may be something in the archive include that is only going to work on posts. I would not use it and would just output the title on your own.

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [August 17, 2022, 3:55pm UTC](https://talk.jekyllrb.com/t/creating-a-second-blog-page/7574/9 "2022-08-17T15:55:35Z")

</div>

> [@toast](#):
>
> I also tried for post in site.blog.posts and no luck

I don’t think that is the correct syntax - did you see that somewhere? or are you just trying random things?

try  
{% for post in site.categories.blog %}

I don’t know all the category ins and outs off the top of my head, a qucik google search for `jekyll posts category` got me a bunch of results like this that look good:

> **[3 Simple steps to setup Jekyll Categories and Tags](https://blog.webjeda.com/jekyll-categories/)**
>
> Why Jekyll Categories or Tags? Imagine you have a blog where you discuss very different things all together. Many bloggers post their personal experiences along with some professional posts. Curating information is very important to make users browse...

keep in mind there are different ways to do things - like the cat can be set via sub folder or front matter, that example uses front matter.

---

<div class="post-metadata">

**Author:** ![toast](https://avatars.discourse-cdn.com/v4/letter/t/6f9a4e/32.png) [@toast](https://talk.jekyllrb.com/u/toast)\
**Post date:** [August 17, 2022, 7:10pm UTC](https://talk.jekyllrb.com/t/creating-a-second-blog-page/7574/10 "2022-08-17T19:10:47Z")

</div>

adding categories to the posts and using liquid to loop over each category worked!
