# Displaying all post with type: "post" as posts

**URL:** <https://discourse.gohugo.io/t/displaying-all-post-with-type-post-as-posts/37743>\
**Category:** Uncategorized\
**Created:** [March 18, 2022, 7:43pm UTC](https://discourse.gohugo.io/t/displaying-all-post-with-type-post-as-posts/37743 "2022-03-18T19:43:54Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Minimouse](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/minimouse/32/1174_2.png) [@Minimouse](https://discourse.gohugo.io/u/Minimouse)\
**Post date:** [March 18, 2022, 7:43pm UTC](https://discourse.gohugo.io/t/displaying-all-post-with-type-post-as-posts/37743/1 "2022-03-18T19:43:54Z")

</div>

Hi,

I have an issue with my settings,

currently the posts listing of my blog only show posts from /content/posts/

even if i set the type: “post”  
when i create a .md in /content/misc, it will not be listed in the posts listing

I’m using the [GitHub - 526avijitgupta/gokarna: A minimal opinionated theme for Hugo](https://github.com/526avijitgupta/gokarna) theme,

i’m not really sure where to look to fix this

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [March 18, 2022, 8:39pm UTC](https://discourse.gohugo.io/t/displaying-all-post-with-type-post-as-posts/37743/2 "2022-03-18T20:39:39Z")

</div>

If your content is in `content/posts` the `.Type` is `posts` (plural).  
If your content is in `content/post` the `.Type` is `post` (singular).

---

<div class="post-metadata">

**Author:** ![anon44707125](https://avatars.discourse-cdn.com/v4/letter/a/e68b1a/32.png) [@anon44707125](https://discourse.gohugo.io/u/anon44707125)\
**Post date:** [March 19, 2022, 7:22am UTC](https://discourse.gohugo.io/t/displaying-all-post-with-type-post-as-posts/37743/3 "2022-03-19T07:22:50Z")

</div>

Is this happening on the homepage? And do you have `type: posts` set in the front matter of every post? Then copy [this file](https://github.com/526avijitgupta/gokarna/blob/main/layouts/index.html) from inside your theme to the main `./layouts` folder in Hugo then change [this line](https://github.com/526avijitgupta/gokarna/blob/main/layouts/index.html#L33) at the end from “post” to “posts”. If you don’t have the post type set in your front matter, then change the whole code to something like `{{ $posts := .Site.RegularPages }}`.

---

<div class="post-metadata">

**Author:** ![anon44707125](https://avatars.discourse-cdn.com/v4/letter/a/e68b1a/32.png) [@anon44707125](https://discourse.gohugo.io/u/anon44707125)\
**Post date:** [March 19, 2022, 7:23am UTC](https://discourse.gohugo.io/t/displaying-all-post-with-type-post-as-posts/37743/4 "2022-03-19T07:23:58Z")

</div>

Or use a [front matter cascade](https://gohugo.io/content-management/front-matter/#example-1) of `type: posts`.

---

<div class="post-metadata">

**Author:** ![Minimouse](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/minimouse/32/1174_2.png) [@Minimouse](https://discourse.gohugo.io/u/Minimouse)\
**Post date:** [March 19, 2022, 4:49pm UTC](https://discourse.gohugo.io/t/displaying-all-post-with-type-post-as-posts/37743/5 "2022-03-19T16:49:50Z")

</div>

in fact i just want to be able to save my posts in anywhere in /content/  
not just in /content/posts/ ; example /content/topic1/post.md

because if i don’t put them in /content/posts/ they are not listed in this page: [http://localhost:4419/posts/](http://localhost:4419/posts/) but they appear in the tag section

using type: “post” is working as index.html in the layout uses:  
{{ $posts := where .Site.Pages “Params.type” “post” }}

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [March 19, 2022, 4:53pm UTC](https://discourse.gohugo.io/t/displaying-all-post-with-type-post-as-posts/37743/6 "2022-03-19T16:53:52Z")

</div>

> [@Minimouse](#):
>
> even if i set the type: “post”  
> when i create a .md in /content/misc, it will not be listed in the posts listing

You say it is not working.

> [@Minimouse](#):
>
> using type: “post” is working as index.html in the layout uses:

Now you say it is working.

Which is it?

---

<div class="post-metadata">

**Author:** ![anon44707125](https://avatars.discourse-cdn.com/v4/letter/a/e68b1a/32.png) [@anon44707125](https://discourse.gohugo.io/u/anon44707125)\
**Post date:** [March 19, 2022, 6:11pm UTC](https://discourse.gohugo.io/t/displaying-all-post-with-type-post-as-posts/37743/7 "2022-03-19T18:11:03Z")

</div>

> [@Minimouse](#):
>
> because if i don’t put them in /content/posts/ they are not listed in this page: [http://localhost:4419/posts/](http://localhost:4419/posts/)

As @jmooring mentioned above, the type corresponds to the section, hence you cannot expect any other posts outside `./content/posts` to appear in that section. So, what do you really want? (if you go to your link and add `topic1` at the end, you will see your posts there! Also, try the front matter cascade option coz that’s what I use on my site)

---

<div class="post-metadata">

**Author:** ![Minimouse](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/minimouse/32/1174_2.png) [@Minimouse](https://discourse.gohugo.io/u/Minimouse)\
**Post date:** [March 19, 2022, 7:34pm UTC](https://discourse.gohugo.io/t/displaying-all-post-with-type-post-as-posts/37743/8 "2022-03-19T19:34:41Z")

</div>

i understand it better now, thanks! sorry for the confusion

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [March 19, 2022, 7:36pm UTC](https://discourse.gohugo.io/t/displaying-all-post-with-type-post-as-posts/37743/9 "2022-03-19T19:36:24Z")

</div>

What was the solution?

---

<div class="post-metadata">

**Author:** ![anon44707125](https://avatars.discourse-cdn.com/v4/letter/a/e68b1a/32.png) [@anon44707125](https://discourse.gohugo.io/u/anon44707125)\
**Post date:** [March 19, 2022, 7:40pm UTC](https://discourse.gohugo.io/t/displaying-all-post-with-type-post-as-posts/37743/10 "2022-03-19T19:40:32Z")

</div>

You should share your solution in case someone else comes across this post. (I should clarify that the front matter cascade option I recommended is if you want to show all posts inside content somewhere, e.g on homepage or related posts). The other option is to group posts in their different sections that you can link to in your menu and other areas.

---

<div class="post-metadata">

**Author:** ![Minimouse](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/minimouse/32/1174_2.png) [@Minimouse](https://discourse.gohugo.io/u/Minimouse)\
**Post date:** [March 19, 2022, 7:53pm UTC](https://discourse.gohugo.io/t/displaying-all-post-with-type-post-as-posts/37743/11 "2022-03-19T19:53:37Z")

</div>

I don’t have a solution. I understand that I was sort of trying to reinvent the wheel,  
your advices made me understand the structure of Hugo a bit better,  
so i’ll for now use the defaut settings, and read about the front matter cascade part to understand it better, and maybe try to work on it later.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [March 19, 2022, 8:07pm UTC](https://discourse.gohugo.io/t/displaying-all-post-with-type-post-as-posts/37743/12 "2022-03-19T20:07:44Z")

</div>

Archived on March 19, 2022, 8:07pm UTC


