Hello,
I’m trying to populate the index.html
page with project
content.
This is the layouts/index.html
.
{{ define "main" }}
<div role="main" class="container">
<div class="portfolio-list">
{{ $paginator := .Paginate (where .Data.Pages "Type" "project") }}
{{ range $paginator.Pages }}
{{ partial "portfolio_piece.html" . }}
{{ end }}
</div>
{{ if or (.Paginator.HasPrev) (.Paginator.HasNext) }}
<ul class="pager main-pager">
{{ if .Paginator.HasPrev }}
<li class="previous">
<a href="{{ .URL }}page/{{ .Paginator.Prev.PageNumber }}">← {{ i18n "newerPosts" }}</a>
</li>
{{ end }}
{{ if .Paginator.HasNext }}
<li class="next">
<a href="{{ .URL }}page/{{ .Paginator.Next.PageNumber }}">{{ i18n "olderPosts" }} →</a>
</li>
{{ end }}
</ul>
{{ end }}
</div>
{{ end }}
It should list the projects in the content
folder.
Here is the folder structure:
├── content
│ ├── _index.md
│ ├── page
│ │ └── about.md
│ ├── post
│ │ ├── proj01.md
│ │ ├── proj02.md
│ │ ├── proj03.md
│ │ └── proj04.md
│ └── project
│ ├── proj01.md
│ ├── proj02.md
│ ├── proj03.md
│ └── proj04.md
The problem is that the generated index doesn’t list projects. Hugo does generate a post
folder and project
folder. What i want is to have the contents of the project/index.html
in the main index.html
. It did work at some point… it stopped at some point, which I assume happened because of changes in Hugo - not sure on which version.