Netlify does not display the latest version

Hello All,

I have read many posts about this issue but with no luck.

I have a blog generated with hugo and deployed in netlify:

My hugo version is: 0.80.0
The command I am building it is: hugo --gc
The above configurations are specified in my netlify.toml file.

When I was publishing a page I changed the wrong publish date on some of the posts. Now I cannot change them back.

When I run the same command locally the posts are generated with the correct dates.
I have the correct posts dates on my github account too. But unfortunately I cannot publish them on the live environment.

I have tried the option Clear cache and deploy site with no luck.

When I check the logs here is what I get:

11:00:00 AM: $ hugo --gc
11:00:00 AM: Start building sites …
11:00:00 AM:                    | EN
11:00:00 AM: -------------------+-----
11:00:00 AM:   Pages            | 45
11:00:00 AM:   Paginator pages  |  0
11:00:00 AM:   Non-page files   |  0
11:00:00 AM:   Static files     | 30
11:00:00 AM:   Processed images |  0
11:00:00 AM:   Aliases          | 15
11:00:00 AM:   Sitemaps         |  1
11:00:00 AM: Creating deploy upload records
11:00:00 AM:   Cleaned          |  0
11:00:00 AM: Total in 219 ms

Which is exactly how it is in my local machine. But on the second step I get:

11:00:00 AM: ────────────────────────────────────────────────────────────────
11:00:00 AM:   2. Deploy site                                                
11:00:00 AM: ────────────────────────────────────────────────────────────────
11:00:00 AM: ​
11:00:00 AM: Starting to deploy site from ''
11:00:00 AM: Creating deploy tree 
11:00:00 AM: 0 new files to upload
11:00:00 AM: 0 new functions to upload
11:00:00 AM: Site deploy was successfully initiated

Which clearly says that there are no files to upload.

Is there any way from my side to force upload the incorrect files?

Thanks in advance!

This generally doesn’t happen. Could you check if that’s happening for just the specific file or for others too?

It happens for others too. Not only for 1 file. If I change the content of the file everything is ok. The date is in the header of the file.

Would it be possible for you to share your repo?

You mean the github repository?

Here it is:

I just tried your repo and it seems to work fine.

First commit (just cloned your repo as it is):

Second commit (date of Be careful with… changed):

I triggered countless builds today. Unfortunately it does not work.
You can see it here
The dates are wrong.

Is there something that I can do?

I think it’s your theme. The file /themes/harbor/layouts/partials/postmeta.html has the following: {{ .Lastmod.Format ( .Site.Params.dateformat | default "Jan 2, 2006") }}. It seems to be relying on the Last Modification time of the file and not the date in the frontmatter. Maybe if you change it to {{ .Date.Format "Jan 2, 2006" }}, it might work.

1 Like

Thank you!

That one did the trick. I suspected the theme at the start but locally everything was working. That’s why I thought it was netlify.

The weird think is that it worked for you too.
I clearly have to spent more time on hugo themes.

If you have an answer and the time to explain why this behavior occurred it will be a very interesting read at least for me.

Thank you very much!