[static site] File's last modified date wrong after deployment

Can someone give me more insights on how Render treats the content received via POST webhook from Gitlab?

I am running into an issue where the deployed LIVE site does not have the correct last modified date on my Hugo site.
On my local machine the last modified dates are correct but the moment the site is deployed to Render, all files show the last modified to today’s date (the date of the deployment).

Here is my workflow:

  1. I git commit to a master branch on Gitlab.
  2. Commit to master branch will trigger the webhook to send POST https://api.render.com/hooks/gitlab request.
  3. Render server receives the POST request and auto deploys with this build command hugo --cleanDestinationDir --gc --minify to public directory.

Hi @sky, welcome to the Render community!

Your workflow of events sounds right - could you let us know what additional context you were looking for in terms of the POST webhook? This essentially acts as a deploy hook to kick off a deploy based on the latest commit from your specified branch. Based on the issue you’re seeing, I suspect this may be moreso to do with the configuration within Hugo. Are you currently setting a lastmod field in the frontmatter of your docs? From Hugo’s documentation:

  • If lastmod is not set, and .GitInfo feature is enabled, .GitInfo.AuthorDate will be used instead.

It sounds like that’s possibly what’s happening here, but let me know if I’m missing something!

Hello @Jade_Paoletta and thanks for the reply.
Apologies I didn’t share more details, this is part of my config.yaml file related to this:

enableGitInfo: true
frontmatter:
  lastmod:
  - :git
  - lastmod
  - date
  - publishDate

I don’t set any lastmod manually in the front matter of single blog posts.

From what I understand, when enableGitInfo is true, the lastmod date will be taken automatically from the last modified date of the given file.

Also, to answer your question:
Your workflow of events sounds right - could you let us know what additional context you were looking for in terms of the POST webhook?
I just want to understand what does your webhook do when change is detected on Gitlab. Does he git pull / git clone the latest changes?