Hello there, I have a little problem with my Hugo website. I am posting this on Gitlab Pages. When I run locally, the index page is working just fine. When it lands on gitlab pages, no matter what I have in index.html
it doesn’t show the contents at all as it can be seen on my website.
Here is the code for the index.html
, which displays a page with blog posts that aren’t pages. On localhost it just works.
{{ define "main" }}
<div class="content">
<main class="posts">
{{- if .Content }}
<div class="content">{{ .Content }}</div>
{{- end }}
{{- range .Data.Pages.GroupByDate "2006" }}
{{- if not (eq .Key "0001") }}
<div class="posts-group">
<div class="post-year">{{ .Key }}</div>
<ul class="posts-list">
{{- range .Pages }}
<li class="post-item">
<a href="{{.Permalink}}">
<span class="post-title">{{.Title}}</span>
<span class="post-day">{{ if .Site.Params.dateformShort }}{{ .Date.Format .Site.Params.dateformShort }}{{ else }}{{ .Date.Format "Jan 02"}}{{ end }}</span>
</a>
</li>
{{- end }}
</ul>
</div>
{{- end }}
{{- end }}
</main>
</div>
{{ end }}
I can’t find the problem why the index page doesn’t work correctly after uploading it to gitlab.