# How to show the list.html in the home page of the hugo site

**URL:** <https://discourse.gohugo.io/t/how-to-show-the-list-html-in-the-home-page-of-the-hugo-site/27682>\
**Category:** support\
**Created:** [August 19, 2020, 2:37pm UTC](https://discourse.gohugo.io/t/how-to-show-the-list-html-in-the-home-page-of-the-hugo-site/27682 "2020-08-19T14:37:26Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Milad\_Y](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/milad_y/32/12179_2.png) [@Milad\_Y](https://discourse.gohugo.io/u/Milad_Y)\
**Post date:** [August 19, 2020, 2:37pm UTC](https://discourse.gohugo.io/t/how-to-show-the-list-html-in-the-home-page-of-the-hugo-site/27682/1 "2020-08-19T14:37:26Z")

</div>

I created a simple loop through posts in in list.html. In the browser when I go to [http://localhost:1313/posts/](http://localhost:1313/posts/) it works correctly. But I want this to be part of the [http://localhost:1313](http://localhost:1313).  
I tried to make this a main block and used in baseof.html as

```auto
   	{{- block "main" . }}{{- end }}

```

but still nothing.

---

<div class="post-metadata">

**Author:** ![sephore](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/sephore/32/11673_2.png) [@sephore](https://discourse.gohugo.io/u/sephore)\
**Post date:** [August 19, 2020, 3:26pm UTC](https://discourse.gohugo.io/t/how-to-show-the-list-html-in-the-home-page-of-the-hugo-site/27682/2 "2020-08-19T15:26:54Z")

</div>

What about your `index.html`?

---

<div class="post-metadata">

**Author:** ![Milad\_Y](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/milad_y/32/12179_2.png) [@Milad\_Y](https://discourse.gohugo.io/u/Milad_Y)\
**Post date:** [August 19, 2020, 3:50pm UTC](https://discourse.gohugo.io/t/how-to-show-the-list-html-in-the-home-page-of-the-hugo-site/27682/3 "2020-08-19T15:50:43Z")

</div>

When I run the following code in the index.html it doesn’t show anything properly it just shows the word “posts” with a date! instead of showing actual posts. it just mentions the posts folder I guess.  
``

```
{{ $paginator := .Paginate (where .Pages "Type" "posts") }}

{{ range $paginator.Pages }}

<article>

<h1>{{.Title}}</h1>
<p class="article-detail-date">{{ .Date.Format "January 2, 2006" }}</p>
<p>{{ .Summary | plainify | safeHTML }}</p>

{{ if .Truncated }}
<a href="{{ .Permalink }}">Read more</a> 
{{ end }}

</article>

{{ end }}

<div class="page-nav">

  {{ if .Paginator.HasPrev }}
  <a href="{{ .Paginator.Prev.URL }}">
    {{- partial "svg/icons" "chevron-left" -}} Newer
  </a>
  {{ else }}
  <div></div>
  {{ end }}

  {{ if .Paginator.HasNext }}
  <a href="{{ .Paginator.Next.URL }}">
    Older {{- partial "svg/icons" "chevron-right" -}}
  </a>
  {{ end }}

</div>

```

``

while the /posts is showing properly

---

<div class="post-metadata">

**Author:** ![sephore](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/sephore/32/11673_2.png) [@sephore](https://discourse.gohugo.io/u/sephore)\
**Post date:** [August 19, 2020, 3:58pm UTC](https://discourse.gohugo.io/t/how-to-show-the-list-html-in-the-home-page-of-the-hugo-site/27682/4 "2020-08-19T15:58:27Z")

</div>

Could you try to replace `.Pages` with `.Site.RegularPages`?

---

<div class="post-metadata">

**Author:** ![Milad\_Y](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/milad_y/32/12179_2.png) [@Milad\_Y](https://discourse.gohugo.io/u/Milad_Y)\
**Post date:** [August 19, 2020, 6:12pm UTC](https://discourse.gohugo.io/t/how-to-show-the-list-html-in-the-home-page-of-the-hugo-site/27682/6 "2020-08-19T18:12:31Z")

</div>

It worked. Why?

---

<div class="post-metadata">

**Author:** ![sephore](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/sephore/32/11673_2.png) [@sephore](https://discourse.gohugo.io/u/sephore)\
**Post date:** [August 19, 2020, 6:26pm UTC](https://discourse.gohugo.io/t/how-to-show-the-list-html-in-the-home-page-of-the-hugo-site/27682/7 "2020-08-19T18:26:10Z")

</div>

[Context](https://gohugo.io/templates/introduction/#the-dot) (`.Something` =/= `.Site.Something`).

---

<div class="post-metadata">

**Author:** ![Milad\_Y](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/milad_y/32/12179_2.png) [@Milad\_Y](https://discourse.gohugo.io/u/Milad_Y)\
**Post date:** [August 19, 2020, 6:32pm UTC](https://discourse.gohugo.io/t/how-to-show-the-list-html-in-the-home-page-of-the-hugo-site/27682/8 "2020-08-19T18:32:04Z")

</div>

Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [August 21, 2020, 6:32pm UTC](https://discourse.gohugo.io/t/how-to-show-the-list-html-in-the-home-page-of-the-hugo-site/27682/9 "2020-08-21T18:32:05Z")

</div>

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