You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This might be a bit difficult to replicate... but I have a Github action that runs SSG daily to update the website. Sometimes it generates {{ date }} properly as September 24th, 2021 and sometimes it just prints the timestamp 2021-09-24 00:00:00.
For example:
I don't notice anything in the logs that's different, and the sync happens daily at the same time so nothing changes between them except new content being added.
If I do re-run the Github Action it generates the page with the normal formatted dates, so nothing changes between runs but it prints the date randomly.
The text was updated successfully, but these errors were encountered:
Just figured out the cause for this accidentally while working on another issue.
The date format is set in a middleware.
On regular content pages (entries etc) middleware doesn't actually get run.
On routes, (e.g. Route::statamic(), extra urls in the config, etc) middleware do get run.
So the date format will only be set on pages after any the middleware has run.
It seems random because we literally randomize the pages before generating them. (#57)
A short term "fix" would be to re-set the date format in the SSG somewhere, rather than rely on the middleware.
A better fix would be to run the middleware. As it stands, if you were attempting to run your own middleware, it wouldn't happen.
This might be a bit difficult to replicate... but I have a Github action that runs SSG daily to update the website. Sometimes it generates
{{ date }}
properly asSeptember 24th, 2021
and sometimes it just prints the timestamp2021-09-24 00:00:00
.For example:
I don't notice anything in the logs that's different, and the sync happens daily at the same time so nothing changes between them except new content being added.
If I do re-run the Github Action it generates the page with the normal formatted dates, so nothing changes between runs but it prints the date randomly.
The text was updated successfully, but these errors were encountered: