Create a series list view and a post list view

I’m trying to create two pages. One that lists all the posts that have the parameter intro set to true and the other one lists all the pages that doesn’t have the parameter intro set to true.

I’m currently thinking of adding series or posts parameter to the _index.md, but I was wondering if there was a better way.

If not, how would I do this?

PS: Sorry if my terminology isn’t correct because I’m just starting to get into hugo.

File structure:

content/
├── posts/
│   ├── post-1.md
│   └── post-2.md
├── views/
│   ├── posts-intro-not-set-to-true/
│   │   └── _index.md               # layout = 'posts-intro-not-set-to-true' 
│   └── posts-intro-set-to-true/
│       └── _index.md               # layout = 'posts-intro-set-to-true'
└── _index.md
layouts/
├── _default/
│   ├── baseof.html
│   ├── home.html
│   ├── list.html
│   └── single.html
└── views/
    ├── posts-intro-not-set-to-true.html
    └── posts-intro-set-to-true.html

Try it:

git clone --single-branch -b hugo-forum-topic-40473 https://github.com/jmooring/hugo-testing hugo-forum-topic-40473
cd hugo-forum-topic-40473
hugo server

Unfortunately, this doesn’t work. Here’s my current directory structure:

.
├── config.toml
├── content
│   ├── posts
│   │   ├── intro-to-note-taking-with-latex.md
│   │   ├── note-taking-with-latex-part-1.md
│   │   ├── note-taking-with-latex-part-2.md
│   │   ├── note-taking-with-latex-part-3.md
│   │   ├── note-taking-with-latex-part-4.md
│   │   ├── note-taking-with-latex-part-5.md
│   │   └── note-taking-with-latex-part-6.md
│   └── views
│       ├── posts
│       │   └── _index.md
│       └── series
│           └── _index.md
├── layouts
│   └── views
│       ├── posts.html
│       └── series.html
├── README.md
└── themes
    └── LoveIt

I’m using the LoveIt theme. You can find my source code here in case you need more information.

In addition, how can I make the series page display something like this:

Series Name 1:
  - Post Intro
  - Post 1
  - Post 2
  - Post 3

Series Name 2:
  - Post Intro
  - Post 1
  - Post 2
  - Post 3

Series Name 3:
  - Post Intro
  - Post 1
  - Post 2
  - Post 3

What doesn’t work? The example I provided works exactly as you described.

NVM. I found my problem. I was putting the series and posts into content instead of content/views/. Thanks.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.