Post are not always showing

Hi,

I’m starting with Hugo and it’s been quite complex for me.
I have this simple section in a partial

    <section>
        <h2>
        {{ .Title }}
        </h2>
        <ul>
            Recent Posts
            {{ range .Pages}}
            <li>
                <a href={{.Permalink}}>{{ .Title }}</a> -
                {{$date := .Date}}
                {{ if and (not $date) .GitInfo }}
                {{$date = .GitInfo.AuthorDate}}
                {{- end -}}
                <time datetime="{{ $date.Format "2006-01-02T15:04:05Z07:00" }}">{{ $date.Format "Monday, Jan 2, 2006."}}</time>
            </li>
            {{ end }}
        </ul>
    </section>

I’m when starting Hugo with hugo server, sometimes is showing my posts and sometimes not in development and never in production.

I’ve only one post in content/en/nasa/_index.md with this meta:

---
title: "Space Center Houston"
date: 2023-11-02T09:00:00-07:00
draft: false
---

Any explanation to this behaviour?

Hi @robergimenez and welcome on this forum

A few hints:

  • AFAIK, GitInfo behavior differs from development and production
  • as a french user, I had to double-check the date to be sure it’s not considered in the past in the actual Hugo environment. I didn’t dig deep in this direction but I sometime manually modified the date
  • you should share the content of your repo, as states in tese guidelines: Requesting Help